init: external init extension

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-01-27 13:58:55 +01:00
parent ca9ea1bf31
commit 3f331dc8e8
2 changed files with 32 additions and 1 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-26-gb45efa3
#### $$VERSION$$ v1.35-dev-27-gca9ea1b
##################################################################
# emmbeded system may claim bash but it is not
@ -1265,6 +1265,8 @@ if [ -z "${SOURCE}" ]; then
;;
# run after every update to update files and adjust permissions
"init")
# shellcheck source=./bin/bashbot._init.inc.sh"
[ -r "${BASHBOT_HOME:-.}/bin/bashbot_init.inc.sh" ] && source "${BASHBOT_HOME:-.}/bin/bashbot_init.inc.sh"
bot_init "$2"
debug_checks "end init" "$@"
exit

29
bin/bashbot_init.inc.sh Normal file
View File

@ -0,0 +1,29 @@
#!/bin/bash
#===============================================================================
#
# FILE: bashbot_init.inc.sh
#
# USAGE: source bashbot_init.inc.sh
#
# DESCRIPTION: extend / overwrite bashbot initialisation
#
# LICENSE: WTFPLv2 http://www.wtfpl.net/txt/copying/
# AUTHOR: KayM (gnadelwartz), kay@rrr.de
# CREATED: 27.01.2021 13:42
#
#### $$VERSION$$ v1.35-dev-27-gca9ea1b
#===============================================================================
##########
# commands to execute before bot_init() is called
#########
# uncomment to overwrite default init
# bot_init() { my_init(); }
########
# called after default init is finished
my_init() {
: # ypur commands here
}