Skip to content

Instantly share code, notes, and snippets.

@rewida17
Created September 2, 2019 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rewida17/cd50a32513bd982c12006e6ea4b0f3c5 to your computer and use it in GitHub Desktop.
Save rewida17/cd50a32513bd982c12006e6ea4b0f3c5 to your computer and use it in GitHub Desktop.
simple "wrapper" around wg and wg-quick that can simplify tasks
#!/bin/bash
if [ "$#" == '0' ]
then
printf 'Enter Parametrs [up|down|show|status|ssh]\n'
elif [ "$1" == 'up' ] || [ "$1" == 'on' ] || [ "$1" == 'start' ]
then
sudo wg-quick up /etc/wireguard/wg0.conf
elif [ "$1" == 'down' ] || [ "$1" == 'off' ] || [ "$1" == 'stop' ]
then
sudo wg-quick down /etc/wireguard/wg0.conf
elif [ "$1" == 'show' ] || [ "$1" == 'status' ]
then
sudo wg show
elif [ "$1" == 'ssh' ]
then
#show Conected devices/transfered data.
printf 'Connected devices:\n'
ssh -C ssh_server ~/bin/wirewrap show
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment