Created
September 2, 2019 18:07
-
-
Save rewida17/cd50a32513bd982c12006e6ea4b0f3c5 to your computer and use it in GitHub Desktop.
simple "wrapper" around wg and wg-quick that can simplify tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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