mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-28 12:50:44 +00:00
init: offer copy config only for new installations
This commit is contained in:
parent
bc414eef5a
commit
08a05242f9
13
bashbot.sh
13
bashbot.sh
@ -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.35-dev-12-g47cab80
|
#### $$VERSION$$ v1.35-dev-13-gbc414ee
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
# emmbeded system may claim bash but it is not
|
# emmbeded system may claim bash but it is not
|
||||||
@ -1137,11 +1137,12 @@ bot_init() {
|
|||||||
printf "Mycommands.sh not found, copy ${GREY}mycommands.sh.dist${NC} to mycommands.sh? (y/N) N\b"
|
printf "Mycommands.sh not found, copy ${GREY}mycommands.sh.dist${NC} to mycommands.sh? (y/N) N\b"
|
||||||
read -r ANSWER
|
read -r ANSWER
|
||||||
[[ "${ANSWER}" =~ ^[Yy] ]] && cp -f "${BASHBOT_ETC:-.}/mycommands.sh.dist" "${BASHBOT_ETC:-.}/mycommands.sh"
|
[[ "${ANSWER}" =~ ^[Yy] ]] && cp -f "${BASHBOT_ETC:-.}/mycommands.sh.dist" "${BASHBOT_ETC:-.}/mycommands.sh"
|
||||||
fi
|
# offer to copy config also
|
||||||
if [ ! -r "${BASHBOT_ETC:-.}/mycommands.conf" ]; then
|
if [ ! -r "${BASHBOT_ETC:-.}/mycommands.conf" ]; then
|
||||||
printf "Mycommands config file not found, copy ${GREY}mycommands.conf.dist${NC} to mycommands.conf? (y/N) N\b"
|
printf "Mycommands config file not found, copy ${GREY}mycommands.conf.dist${NC} to mycommands.conf? (y/N) N\b"
|
||||||
read -r ANSWER
|
read -r ANSWER
|
||||||
[[ "${ANSWER}" =~ ^[Yy] ]] && cp -f "${BASHBOT_ETC:-.}/mycommands.conf.dist" "${BASHBOT_ETC:-.}/mycommands.conf"
|
[[ "${ANSWER}" =~ ^[Yy] ]] && cp -f "${BASHBOT_ETC:-.}/mycommands.conf.dist" "${BASHBOT_ETC:-.}/mycommands.conf"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# adjust permissions
|
# adjust permissions
|
||||||
printf "Adjusting files and permissions for user \"${touser}\" ...\n"
|
printf "Adjusting files and permissions for user \"${touser}\" ...\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user