init: finalize external init

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-01-27 16:29:58 +01:00
parent 0c0dc01f26
commit e83f4d443f
2 changed files with 12 additions and 8 deletions

View File

@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb
# 8 - curl/wget missing
# 10 - not bash!
#
#### $$VERSION$$ v1.35-dev-28-g3f331dc
#### $$VERSION$$ v1.35-dev-29-g0c0dc01
##################################################################
# emmbeded system may claim bash but it is not
@ -1108,7 +1108,7 @@ start_bot() {
bot_init() {
[ -n "${BASHBOT_HOME}" ] && cd "${BASHBOT_HOME}" || exit 1
# load addons on startup
printf "Initialize modules and addons ...\n"
printf "Initialize addons ...\n"
for addons in "${ADDONDIR:-.}"/*.sh ; do
# shellcheck source=./modules/aliases.sh
[ -r "${addons}" ] && source "${addons}" "init" "$1"

View File

@ -11,28 +11,32 @@
# AUTHOR: KayM (gnadelwartz), kay@rrr.de
# CREATED: 27.01.2021 13:42
#
#### $$VERSION$$ v1.35-dev-28-g3f331dc
#### $$VERSION$$ v1.35-dev-29-g0c0dc01
#===============================================================================
# shellcheck disable=SC2059
##########
# commands to execute before bot_init() is called
########
# called after default init is finished
my_init() {
: # ypur commands here
: # your init here
}
#########
# extended initialisation for advanced features like:
#
# running bto as rest
# extended initialisation:
#
# - uograde old config
# - backup of botconfig.jssh
# - running bot as service or other user
# - copy clean and dist files if not exist
# - configure bot for INLINE CALLBACK MEONLY SILENCER
#
# delete from here to disable extended init
# delete from here to disable extended initialisation
bot_init() {
[ -n "${BASHBOT_HOME}" ] && cd "${BASHBOT_HOME}" || exit 1
local runuser chown touser botname DEBUG="$1"