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:
+10
-10
@@ -5,15 +5,15 @@
|
||||
# http://web-74.com/blog/reseaux/gerer-le-deploiement-facilement-avec-git/
|
||||
#
|
||||
|
||||
echo -e '\033[35m
|
||||
printf '\033[35m
|
||||
____ __ _ _____
|
||||
/ __ \___ / /_ (_)___ _____ / ___/___ ______ _____ _____
|
||||
/ / / / _ \/ __ \/ / __ `/ __ \ \__ \/ _ \/ ___/ | / / _ \/ ___/
|
||||
/ /_/ / __/ /_/ / / /_/ / / / / ___/ / __/ / | |/ / __/ /
|
||||
/_____/\___/_.___/_/\__,_/_/ /_/ /____/\___/_/ |___/\___/_/
|
||||
|
||||
\033[0m'
|
||||
echo -e "\033[35;1mThis script has been tested only on Linux Debian 10 \033[0m"
|
||||
\033[0m\n'
|
||||
printf "\033[35;1mThis script has been tested only on Linux Debian 10 \033[0m\n"
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Please run as root"
|
||||
@@ -111,13 +111,13 @@ fi
|
||||
|
||||
# . bin/autoupdate.sh
|
||||
|
||||
# echo -e '\033[35m
|
||||
# printf '\033[35m
|
||||
# ______________ _______
|
||||
# /_ __/ ____/ |/ / __ \
|
||||
# / / / __/ / /|_/ / /_/ /
|
||||
# / / / /___/ / / / ____/
|
||||
# /_/ /_____/_/ /_/_/
|
||||
# \033[0m'
|
||||
# \033[0m\n'
|
||||
# function check_tmp_secured {
|
||||
|
||||
# temp1=`grep -w "/var/tempFS /tmp ext3 loop,nosuid,noexec,rw 0 0" /etc/fstab | wc -l`
|
||||
@@ -158,14 +158,14 @@ fi
|
||||
# # Remove old tmp dir
|
||||
# rm -rf /var/tmpbackup
|
||||
|
||||
# echo -e "\033[35;1m /tmp and /var/tmp secured using tmpfs. \033[0m"
|
||||
# printf "\033[35;1m /tmp and /var/tmp secured using tmpfs. \033[0m\n"
|
||||
# } # End function secure_tmp_tmpfs
|
||||
|
||||
# check_tmp_secured
|
||||
# if [ $? = 0 ]; then
|
||||
# secure_tmp_tmpfs
|
||||
# else
|
||||
# echo -e "\033[35;1mFunction canceled. /tmp already secured. \033[0m"
|
||||
# printf "\033[35;1mFunction canceled. /tmp already secured. \033[0m\n"
|
||||
# fi
|
||||
|
||||
# TODO add warning message on ssh connection if system needs updates
|
||||
@@ -174,11 +174,11 @@ fi
|
||||
|
||||
|
||||
|
||||
echo -e '\033[35m
|
||||
printf '\033[35m
|
||||
__
|
||||
___ ____ ____/ /
|
||||
/ _ \/ __ \/ __ /
|
||||
/ __/ / / / /_/ /
|
||||
\___/_/ /_/\__,_/
|
||||
\033[0m'
|
||||
echo -e "\033[35;1m* * script done * * \033[0m"
|
||||
\033[0m\n'
|
||||
printf "\033[35;1m* * script done * * \033[0m\n"
|
||||
|
||||
Reference in New Issue
Block a user