From 08a05242f992bf7464e9217df29f73934b027cd3 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Tue, 26 Jan 2021 13:02:04 +0100 Subject: [PATCH] init: offer copy config only for new installations --- bashbot.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bashbot.sh b/bashbot.sh index 60ff4d5..6842e4a 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -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-12-g47cab80 +#### $$VERSION$$ v1.35-dev-13-gbc414ee ################################################################## # 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" read -r ANSWER [[ "${ANSWER}" =~ ^[Yy] ]] && cp -f "${BASHBOT_ETC:-.}/mycommands.sh.dist" "${BASHBOT_ETC:-.}/mycommands.sh" - fi - 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" - read -r ANSWER - [[ "${ANSWER}" =~ ^[Yy] ]] && cp -f "${BASHBOT_ETC:-.}/mycommands.conf.dist" "${BASHBOT_ETC:-.}/mycommands.conf" + # offer to copy config also + 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" + read -r ANSWER + [[ "${ANSWER}" =~ ^[Yy] ]] && cp -f "${BASHBOT_ETC:-.}/mycommands.conf.dist" "${BASHBOT_ETC:-.}/mycommands.conf" + fi fi # adjust permissions printf "Adjusting files and permissions for user \"${touser}\" ...\n"