Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Support two easy programming solution

Hallo everybody,

I am just an hobby VPS'ler. I am running some rented Servers here. For automatation reason I try to find a solution for me.
Please help me out.

First is I want automate update script the firewall ufw. For this reason I am stuck with the port of wireguard.

I want combine two linux command. I dont know how

command wg show | grep port
output is
listening port: 50 #the port is different in every of my VPS.

hope the get the command
ufw allow 50

Second is extend very common github wireguard script

After first configuration i want create 10 user with one command or one bash script.

I have try
wget https://git.io/wireguard -O wireguard-install.sh && bash wireguard-install.sh -1 -13 -3
but it is not really working.

Please excuse my easy question, but as mechanical engineer. I am not quite skilled in the IT. Google or other Investigation I could not find a solution.

Comments

  • LisoLiso Member
    edited September 2022

    Maybe this ? This will tell awk to find line with port in it, then print last field.

    ufw allow $(wg show | awk '/port/{ print $NF }')
    

    This assume port always located in last field, I don't use wireguard so I don't know.

    Thanked by 1Durs
  • i will try thank you

Sign In or Register to comment.