Replace echo -e with printf for portable ANSI banners

dash (Debian's /bin/sh) doesn't support echo's -e flag: it prints "-e"
literally as text before processing the rest of the string's backslash
escapes. Every script's colored banner was affected. printf's escape
handling is POSIX-mandated and behaves identically under dash and bash,
so swap all 90 echo -e calls for printf, appending the trailing \n that
echo used to add implicitly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-04 09:35:02 +02:00
co-authored by Claude Sonnet 5
parent 7ff4df1173
commit 2e3ec7883f
24 changed files with 124 additions and 124 deletions
+4 -4
View File
@@ -2,14 +2,14 @@
# TODO check if root
echo -e '\033[35m
printf '\033[35m
______ _ _____ __
/ ____/___ _(_) /__ \ / /_ ____ _____
/ /_ / __ `/ / /__/ // __ \/ __ `/ __ \
/ __/ / /_/ / / // __// /_/ / /_/ / / / /
/_/ \__,_/_/_//____/_.___/\__,_/_/ /_/
\033[0m'
echo -e "\033[35;1mInstalling fall2ban \033[0m"
\033[0m\n'
printf "\033[35;1mInstalling fall2ban \033[0m\n"
if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root"
@@ -23,4 +23,4 @@ cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
touch /var/log/auth.log
systemctl enable fail2ban
systemctl restart fail2ban
echo -e "\033[92;1mfail2ban installed and configured\033[Om"
printf "\033[92;1mfail2ban installed and configured\033[Om\n"