mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Failsafe home dir obtaining
+ When estimating $INSTALL_HOME, assure grep can only match user names, to avoid possible wrong multi-line value + Remove possible trailing slash from $INSTALL_HOME, to avoid double slash in "$INSTALL_HOME/ovpns" + Avoid "cat <file> | grep <pattern>", since grep can process files directly Signed-off-by: MichaIng <micha@dietpi.com>
This commit is contained in:
parent
73b23c525b
commit
51333a9313
1 changed files with 2 additions and 1 deletions
|
@ -2,7 +2,8 @@
|
||||||
# PiVPN: Uninstall Script
|
# PiVPN: Uninstall Script
|
||||||
|
|
||||||
INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER)
|
INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER)
|
||||||
INSTALL_HOME=$(cat /etc/passwd | grep "$INSTALL_USER" | cut -d: -f6)
|
INSTALL_HOME=$(grep -m1 "^${INSTALL_USER}:" /etc/passwd | cut -d: -f6)
|
||||||
|
INSTALL_HOME=${INSTALL_HOME%/} # remove possible trailing slash
|
||||||
PLAT=$(cat /etc/pivpn/DET_PLATFORM)
|
PLAT=$(cat /etc/pivpn/DET_PLATFORM)
|
||||||
NO_UFW=$(cat /etc/pivpn/NO_UFW)
|
NO_UFW=$(cat /etc/pivpn/NO_UFW)
|
||||||
OLD_UFW=$(cat /etc/pivpn/NO_UFW)
|
OLD_UFW=$(cat /etc/pivpn/NO_UFW)
|
||||||
|
|
Loading…
Reference in a new issue