bin/ check files before include

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-12-26 20:39:21 +01:00
parent 00af5b86c8
commit 232a16bc90
2 changed files with 9 additions and 9 deletions

View File

@ -13,7 +13,7 @@
# AUTHOR: KayM (gnadelwartz), kay@rrr.de
# CREATED: 18.12.2020 12:27
#
#### $$VERSION$$ v1.20-0-g2ab00a2
#### $$VERSION$$ v1.20-2-g00af5b8
#===============================================================================
############
@ -36,15 +36,8 @@ BASHBOT_ETC="${BASHBOT_HOME}"
if [ ! -r "${BASHBOT_HOME}/bashbot.sh" ]; then
echo "Bashbot.sh not found in \"${BASHBOT_HOME}\""
exit 4
else
# shellcheck disable=SC1090
source "${BASHBOT_HOME}/bashbot.sh" source "$1"
fi
# overwrite bot FILE regex to BASHBOT_ETC
# change this to the location you want to allow file uploads from
FILE_REGEX="${BASHBOT_ETC%/bin*}/.*"
# check for botconfig.jssh readable
if [ ! -r "${BASHBOT_ETC}/botconfig.jssh" ]; then
echo "Bashbot config file in \"${BASHBOT_ETC}\" does not exist or is not readable."
@ -56,6 +49,13 @@ if [ ! -r "${BASHBOT_VAR}/count.jssh" ]; then
exit 3
fi
# shellcheck disable=SC1090
source "${BASHBOT_HOME}/bashbot.sh" source "$1"
# overwrite bot FILE regex to BASHBOT_ETC
# change this to the location you want to allow file uploads from
FILE_REGEX="${BASHBOT_ETC%/bin*}/.*"
# get and check ADMIN and NAME
BOT_ADMIN="$(getConfigKey "botadmin")"
BOT_NAME="$(getConfigKey "botname")"

View File

@ -351,5 +351,5 @@ fi
#### [Prev Function Reference](6_reference.md)
#### $$VERSION$$ v1.20-1-g239dd76
#### $$VERSION$$ v1.20-2-g00af5b8