exit install script when running from planned install directory

This commit is contained in:
Stevie Robinson 2024-01-05 19:43:31 +01:00
parent 8f7f23c938
commit efbaf81190
1 changed files with 5 additions and 0 deletions

View File

@ -42,6 +42,11 @@ bindir="${installdir}/${app^}" # Full Path to Install Location
datadir="/var/lib/$app/" # {Update me if needed} AppData directory to use
app_bin=${app^} # Binary Name of the app
if [ "$bindir" == $(dirname -- "$( readlink -f -- "$0"; )") ]; then
echo "You should not run this script from the intended install directory. The script will exit. Please re-run it from another directory"
exit
fi
# Prompt User
read -r -p "What user should ${app^} run as? (Default: $app): " app_uid < /dev/tty
app_uid=$(echo "$app_uid" | tr -d ' ')