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
@@ -4,14 +4,14 @@
|
||||
|
||||
# TODO check if root
|
||||
|
||||
echo -e '\033[35m
|
||||
printf '\033[35m
|
||||
__ _______ __________
|
||||
/ / / / ___// ____/ __ \
|
||||
/ / / /\__ \/ __/ / /_/ /
|
||||
/ /_/ /___/ / /___/ _, _/
|
||||
\____//____/_____/_/ |_|
|
||||
\033[0m'
|
||||
echo -e "\033[35;1mCreate new user (you will be asked a user name and a password) \033[0m"
|
||||
\033[0m\n'
|
||||
printf "\033[35;1mCreate new user (you will be asked a user name and a password) \033[0m\n"
|
||||
sleep 3
|
||||
while [ "$user" = "" ]
|
||||
do
|
||||
@@ -34,14 +34,14 @@ mkdir /home/$user/backups
|
||||
|
||||
chmod -w /home/"$user"
|
||||
|
||||
echo -e '\033[35m
|
||||
printf '\033[35m
|
||||
__ __
|
||||
_ __/ /_ ____ _____/ /_
|
||||
| | / / __ \/ __ \/ ___/ __/
|
||||
| |/ / / / / /_/ (__ ) /_
|
||||
|___/_/ /_/\____/____/\__/
|
||||
\033[0m'
|
||||
echo -e "\033[35;1mVHOST install \033[0m"
|
||||
\033[0m\n'
|
||||
printf "\033[35;1mVHOST install \033[0m\n"
|
||||
|
||||
while [ "$_host_name" = "" ]
|
||||
do
|
||||
@@ -75,20 +75,20 @@ ln -s /home/"$user"/logs /var/www/"$_host_name"/logs
|
||||
# a2ensite "$_host_name".conf
|
||||
#restart apache
|
||||
# service apache2 restart
|
||||
echo -e "\033[92;1mvhost $_host_name configured\033[Om"
|
||||
printf "\033[92;1mvhost $_host_name configured\033[Om\n"
|
||||
|
||||
|
||||
# todo add mysql user and database
|
||||
|
||||
echo -e '\033[35m
|
||||
printf '\033[35m
|
||||
__ ___ __
|
||||
/ |/ /_ ___________ _/ /
|
||||
/ /|_/ / / / / ___/ __ `/ /
|
||||
/ / / / /_/ (__ ) /_/ / /
|
||||
/_/ /_/\__, /____/\__, /_/
|
||||
/____/ /_/
|
||||
\033[0m'
|
||||
echo -e "\033[35;1mMysql database \033[0m"
|
||||
\033[0m\n'
|
||||
printf "\033[35;1mMysql database \033[0m\n"
|
||||
|
||||
while [ "$_dbname" = "" ]
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user