mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 10:50:16 +00:00
fix(scripts): #issue-1747767321 ensure only "user" is disabled
* fix common https://github.com/pivpn/pivpn/issues/1733#issue-1747767321 pivpn -off/-on user (en-/dis-)ables also user-1, user-2...user-n this fix prevents from (en-/dis-)ableing user-1 ...user-n
This commit is contained in:
parent
241d7c4209
commit
d54e0a452d
2 changed files with 4 additions and 4 deletions
|
@ -110,8 +110,8 @@ for CLIENT_NAME in "${CLIENTS_TO_CHANGE[@]}"; do
|
|||
# Disable the peer section from the server config
|
||||
echo "${CLIENT_NAME}"
|
||||
|
||||
sed_pattern="/### begin ${CLIENT_NAME}/,"
|
||||
sed_pattern="${sed_pattern}/end ${CLIENT_NAME}/ s/^/#\[disabled\] /"
|
||||
sed_pattern="/### begin ${CLIENT_NAME} ###/,"
|
||||
sed_pattern="${sed_pattern}/### end ${CLIENT_NAME} ###/ s/^/#\[disabled\] /"
|
||||
sed -e "${sed_pattern}" -i wg0.conf
|
||||
unset sed_pattern
|
||||
|
||||
|
|
|
@ -110,8 +110,8 @@ for CLIENT_NAME in "${CLIENTS_TO_CHANGE[@]}"; do
|
|||
# Enable the peer section from the server config
|
||||
echo "${CLIENT_NAME}"
|
||||
|
||||
sed_pattern="/begin ${CLIENT_NAME}/,"
|
||||
sed_pattern="${sed_pattern}/end ${CLIENT_NAME}/ s/#\[disabled\] //"
|
||||
sed_pattern="/### begin ${CLIENT_NAME} ###/,"
|
||||
sed_pattern="${sed_pattern}/### end ${CLIENT_NAME} ###/ s/#\[disabled\] //"
|
||||
sed -e "${sed_pattern}" -i wg0.conf
|
||||
unset sed_pattern
|
||||
|
||||
|
|
Loading…
Reference in a new issue