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
+5 -5
View File
@@ -1,12 +1,12 @@
echo -e '\033[35m
printf '\033[35m
__ __
_ __/ /_ ____ _____/ /_
| | / / __ \/ __ \/ ___/ __/
| |/ / / / / /_/ (__ ) /_
|___/_/ /_/\____/____/\__/
\033[0m'
echo -e "\033[35;1mNginx VHOST install \033[0m"
\033[0m\n'
printf "\033[35;1mNginx VHOST install \033[0m\n"
while [ "$vh" != "y" ] && [ "$vh" != "n" ]
do
echo -n "Should we install a vhost? [y|n] "
@@ -53,7 +53,7 @@ if [ "$vh" = "y" ]; then
_letsencrypt=""
while [ "$_letsencrypt" != "yes" ] && [ "$_letsencrypt" != "no" ]
do
echo -e "\033[35;1mLet's encrypt \033[0m"
printf "\033[35;1mLet's encrypt \033[0m\n"
echo "Let's encrypt needs a public registered domain name with proper DNS records ( A records or CNAME records for subdomains pointing to your server)."
echo -n "Should we install let's encrypt certificate with $_domain? [yes|no] "
read _letsencrypt
@@ -162,7 +162,7 @@ if [ "$vh" = "y" ]; then
# restart nginx
systemctl restart nginx
echo -e "\033[92;1mvhost $_domain configured \033[Om"
printf "\033[92;1mvhost $_domain configured \033[Om\n"
else
echo "Vhost installation aborted"
fi