chore: Use cd ... || exit in case cd fails

This commit is contained in:
txtsd 2022-04-06 18:04:23 +05:30
parent 031d271d62
commit 189a7eecc5
No known key found for this signature in database
GPG Key ID: 000F85679D4B6B53
4 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
BASEDIR=$(dirname "$0")
cd "${BASEDIR}"
cd "${BASEDIR}" || exit 1
BASEDIR=`pwd`
source config.sh

View File

@ -2,7 +2,7 @@
echo "Launch args: $@"
if [ "$1" == "update" ]; then
cd /app
cd /app || exit 1
exec su user -c "bash ./update.sh"
elif [ "$1" == "cron" ]; then
exec cron -f

View File

@ -1,7 +1,7 @@
#!/bin/bash
BASEDIR=$(dirname "$0")
cd "${BASEDIR}"
cd "${BASEDIR}" || exit 1
BASEDIR=`pwd`
source config.sh

View File

@ -1,7 +1,7 @@
#!/bin/bash
BASEDIR=$(dirname "$0")
cd "${BASEDIR}"
cd "${BASEDIR}" || exit 1
BASEDIR=`pwd`
set -x