Skip to content

Commit

Permalink
fix(scripts): Match full client name when disabling
Browse files Browse the repository at this point in the history
This fix prevents "pivpn -off" from failing to disable a client when another client is already disabled and the disabled client name starts with the client name you're trying to disable.
e.g. "user-1" wasn't able to be disabled if "user" was already disabled.
  • Loading branch information
camdenAR authored and coolapso committed Oct 21, 2023
1 parent 16189ed commit f9ae966
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/wireguard/disableCONF.sh
Expand Up @@ -97,7 +97,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
Expand Down

0 comments on commit f9ae966

Please sign in to comment.