mirror of
https://github.com/pivpn/pivpn.git
synced 2025-04-22 15:20:11 +00:00
Properly determine user's home directory
Code assumes that the specified user directory is under /home. This code parses the /etc/passwd file in order to determine what that user's proper home directory is.
This commit is contained in:
parent
8e3a951524
commit
8b40035bf5
4 changed files with 13 additions and 9 deletions
|
@ -17,6 +17,7 @@ else
|
|||
fi
|
||||
|
||||
INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER)
|
||||
INSTALL_HOME=$(cat /etc/passwd | grep "$INSTALL_USER" | cut -d: -f6)
|
||||
PLAT=$(cat /etc/pivpn/DET_PLATFORM)
|
||||
NO_UFW=$(cat /etc/pivpn/NO_UFW)
|
||||
PORT=$(cat /etc/pivpn/INSTALL_PORT)
|
||||
|
@ -83,7 +84,7 @@ echo ":::"
|
|||
echo "::: Removing pivpn system files..."
|
||||
$SUDO rm -rf /opt/pivpn &> /dev/null
|
||||
$SUDO rm -rf /etc/.pivpn &> /dev/null
|
||||
$SUDO rm -rf /home/$INSTALL_USER/ovpns &> /dev/null
|
||||
$SUDO rm -rf $INSTALL_HOME/ovpns &> /dev/null
|
||||
|
||||
$SUDO rm -rf /var/log/*pivpn* &> /dev/null
|
||||
$SUDO rm -rf /var/log/*openvpn* &> /dev/null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue