diff --git a/scripts/wireguard/bash-completion b/scripts/wireguard/bash-completion index 3af6c28..ae57b41 100644 --- a/scripts/wireguard/bash-completion +++ b/scripts/wireguard/bash-completion @@ -4,8 +4,8 @@ _pivpn() COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - dashopts="-a -c -d -l -qr -r -h -u -up -bk -dis -ena" - opts="add clients debug list qrcode remove help uninstall update backup disable enable" + dashopts="-a -c -d -l -qr -r -h -u -up -bk -off -on" + opts="add clients debug list qrcode remove help uninstall update backup (temp) off (temp) on" if [ "${#COMP_WORDS[@]}" -eq 2 ] then if [[ ${cur} == -* ]] ; then diff --git a/scripts/wireguard/disableCONF.sh b/scripts/wireguard/disableCONF.sh index 16dcfe7..61ea52e 100755 --- a/scripts/wireguard/disableCONF.sh +++ b/scripts/wireguard/disableCONF.sh @@ -46,13 +46,13 @@ done cd /etc/wireguard if [ ! -s configs/clients.txt ]; then - echo "::: There are no clients to remove" + echo "::: There are no clients to change" exit 1 fi if [ "$DISPLAY_DISABLED" ]; then - grep 'disabled### begin' wg0.conf | sed 's/#//g; s/begin//' + grep '\[disabled\] ### begin' wg0.conf | sed 's/#//g; s/begin//' exit 1 fi @@ -86,7 +86,7 @@ for CLIENT_NAME in "${CLIENTS_TO_CHANGE[@]}"; do if ! grep -q "^${CLIENT_NAME} " configs/clients.txt; then echo -e "::: \e[1m${CLIENT_NAME}\e[0m does not exist" - elif grep -q "#disabled### begin ${CLIENT_NAME}" wg0.conf; then + elif grep -q "#\[disabled\] ### begin ${CLIENT_NAME}" wg0.conf; then echo -e "::: \e[1m${CLIENT_NAME}\e[0m is already disabled" else if [ -n "$CONFIRM" ]; then @@ -99,7 +99,7 @@ for CLIENT_NAME in "${CLIENTS_TO_CHANGE[@]}"; do # Disable the peer section from the server config echo "${CLIENT_NAME}" - sed -e "/### begin ${CLIENT_NAME}/,/end ${CLIENT_NAME}/ s/^/#disabled/" -i wg0.conf + sed -e "/### begin ${CLIENT_NAME}/,/end ${CLIENT_NAME}/ s/^/#\[disabled\] /" -i wg0.conf echo "::: Updated server config" ((CHANGED_COUNT++)) diff --git a/scripts/wireguard/pivpn.sh b/scripts/wireguard/pivpn.sh index b157431..4679e13 100755 --- a/scripts/wireguard/pivpn.sh +++ b/scripts/wireguard/pivpn.sh @@ -86,18 +86,18 @@ showHelp(){ echo "::: Usage: pivpn [option]" echo ":::" echo "::: Commands:" - echo "::: -a, add Create a client conf profile" - echo "::: -c, clients List any connected clients to the server" - echo "::: -d, debug Start a debugging session if having trouble" - echo "::: -l, list List all clients" - echo "::: -qr, qrcode Show the qrcode of a client for use with the mobile app" - echo "::: -r, remove Remove a client" - echo "::: -off, off Disable a user" - echo "::: -on , on Enable a user" - echo "::: -h, help Show this help dialog" - echo "::: -u, uninstall Uninstall pivpn from your system!" - echo "::: -up, update Updates PiVPN Scripts" - echo "::: -bk, backup Backup VPN configs and user profiles" + echo "::: -a, add Create a client conf profile" + echo "::: -c, clients List any connected clients to the server" + echo "::: -d, debug Start a debugging session if having trouble" + echo "::: -l, list List all clients" + echo "::: -qr, qrcode Show the qrcode of a client for use with the mobile app" + echo "::: -r, remove Remove a client" + echo "::: -off, off Disable a user" + echo "::: -on, on Enable a user" + echo "::: -h, help Show this help dialog" + echo "::: -u, uninstall Uninstall pivpn from your system!" + echo "::: -up, update Updates PiVPN Scripts" + echo "::: -bk, backup Backup VPN configs and user profiles" exit 0 }