mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-29 05:02:46 +00:00
bin/ check files before include
This commit is contained in:
parent
00af5b86c8
commit
232a16bc90
@ -13,7 +13,7 @@
|
|||||||
# AUTHOR: KayM (gnadelwartz), kay@rrr.de
|
# AUTHOR: KayM (gnadelwartz), kay@rrr.de
|
||||||
# CREATED: 18.12.2020 12:27
|
# 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
|
if [ ! -r "${BASHBOT_HOME}/bashbot.sh" ]; then
|
||||||
echo "Bashbot.sh not found in \"${BASHBOT_HOME}\""
|
echo "Bashbot.sh not found in \"${BASHBOT_HOME}\""
|
||||||
exit 4
|
exit 4
|
||||||
else
|
|
||||||
# shellcheck disable=SC1090
|
|
||||||
source "${BASHBOT_HOME}/bashbot.sh" source "$1"
|
|
||||||
fi
|
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
|
# check for botconfig.jssh readable
|
||||||
if [ ! -r "${BASHBOT_ETC}/botconfig.jssh" ]; then
|
if [ ! -r "${BASHBOT_ETC}/botconfig.jssh" ]; then
|
||||||
echo "Bashbot config file in \"${BASHBOT_ETC}\" does not exist or is not readable."
|
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
|
exit 3
|
||||||
fi
|
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
|
# get and check ADMIN and NAME
|
||||||
BOT_ADMIN="$(getConfigKey "botadmin")"
|
BOT_ADMIN="$(getConfigKey "botadmin")"
|
||||||
BOT_NAME="$(getConfigKey "botname")"
|
BOT_NAME="$(getConfigKey "botname")"
|
||||||
|
@ -351,5 +351,5 @@ fi
|
|||||||
|
|
||||||
#### [Prev Function Reference](6_reference.md)
|
#### [Prev Function Reference](6_reference.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v1.20-1-g239dd76
|
#### $$VERSION$$ v1.20-2-g00af5b8
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user