refactor(telegram-bot): update telegram-bot installer #251

Merged
dw-0 merged 11 commits from update-telegram-bot into master 2022-10-30 18:30:20 +01:00
Showing only changes of commit 1edc1f0169 - Show all commits

View File

@@ -522,8 +522,9 @@ function patch_telegram_bot_update_manager() {
regex="\/home\/${USER}\/([A-Za-z0-9_]+)\/config\/moonraker\.conf"
moonraker_configs=$(find "${HOME}" -maxdepth 3 -type f -regextype posix-extended -regex "${regex}" | sort)
patched="false"
for conf in ${moonraker_configs}; do
if ! grep -Eq "^\[update_manager moonraker-telegram-bot\]$" "${conf}"; then
if ! grep -Eq "^\[update_manager moonraker-telegram-bot\]\s*$" "${conf}"; then
### add new line to conf if it doesn't end with one
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"