Created
March 4, 2021 10:49
-
-
Save tsundokul/916873e94897dea8c770f55faa896b99 to your computer and use it in GitHub Desktop.
Add Wireguard user without restarting the service
This file contains hidden or 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 | |
# call as sudo ./script <key> <ip> <mask> [iface] | |
iface=${4:-wg0} | |
wg set peer ${1} allowed-ips=${2}/${3} | |
wg-quick save ${iface} | |
ip route add ${2} ${iface} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment