mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-02-06 12:18:33 +00:00
test: fix init test
This commit is contained in:
parent
eee5458232
commit
2f6f3bd4d8
@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb
|
|||||||
# 8 - curl/wget missing
|
# 8 - curl/wget missing
|
||||||
# 10 - not bash!
|
# 10 - not bash!
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v1.45-dev-3-g429c230
|
#### $$VERSION$$ v1.45-dev-5-geee5458
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
# are we running in a terminal?
|
# are we running in a terminal?
|
||||||
@ -276,8 +276,6 @@ if [ -z "${BOTTOKEN}" ]; then
|
|||||||
printf '["botadmin"]\t"%s"\n' "${admin}" >> "${BOTCONFIG}.jssh"
|
printf '["botadmin"]\t"%s"\n' "${admin}" >> "${BOTCONFIG}.jssh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# skip on init
|
|
||||||
if [ "$1" != "init" ]; then
|
|
||||||
# setup botacl file
|
# setup botacl file
|
||||||
if [ ! -f "${BOTACL}" ]; then
|
if [ ! -f "${BOTACL}" ]; then
|
||||||
printf "${GREY}Create initial ${BOTACL} file.${NN}"
|
printf "${GREY}Create initial ${BOTACL} file.${NN}"
|
||||||
@ -286,7 +284,7 @@ if [ -z "${BOTTOKEN}" ]; then
|
|||||||
# check data dir file
|
# check data dir file
|
||||||
if [ ! -w "${DATADIR}" ]; then
|
if [ ! -w "${DATADIR}" ]; then
|
||||||
printf "${RED}ERROR: ${DATADIR} does not exist or is not writeable!.${NN}"
|
printf "${RED}ERROR: ${DATADIR} does not exist or is not writeable!.${NN}"
|
||||||
exit_source 2
|
[ "$1" != "init" ] && exit_source 2 # skip on init
|
||||||
fi
|
fi
|
||||||
# setup count file
|
# setup count file
|
||||||
if [ ! -f "${COUNTFILE}.jssh" ]; then
|
if [ ! -f "${COUNTFILE}.jssh" ]; then
|
||||||
@ -300,7 +298,6 @@ if [ -z "${BOTTOKEN}" ]; then
|
|||||||
printf '["blocked_user_or_chat_id"]\t"name and reason"\n' >>"${BLOCKEDFILE}.jssh"
|
printf '["blocked_user_or_chat_id"]\t"name and reason"\n' >>"${BLOCKEDFILE}.jssh"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d "${LOGDIR}" || ! -w "${LOGDIR}" ]]; then
|
if [[ ! -d "${LOGDIR}" || ! -w "${LOGDIR}" ]]; then
|
||||||
LOGDIR="${RUNDIR:-.}"
|
LOGDIR="${RUNDIR:-.}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user