Work around illegal (but sometimes happening) PWD state

This commit is contained in:
Reinhard Pointner 2016-04-09 15:15:08 +00:00
parent 925f5526ba
commit 42393fa8da
1 changed files with 7 additions and 2 deletions

View File

@ -17,8 +17,13 @@ WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"` PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR" && pwd` APP_ROOT=`cd "$PRG_DIR" && pwd`
# restore original working dir # restore original working dir (which may be /root and yield permission denied)
cd "$WORKING_DIR" if [ -x "$WORKING_DIR" ]; then
cd "$WORKING_DIR"
else
cd "/volume1"
fi
# make sure required environment variables are set # make sure required environment variables are set
if [ -z "$USER" ]; then if [ -z "$USER" ]; then