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
+35 -35
View File
@@ -1,14 +1,14 @@
#!/bin/sh
echo -e '\033[35m
printf '\033[35m
__
/ /__ ____ ___ ____
/ / _ \/ __ `__ \/ __ \
/ / __/ / / / / / /_/ /
/_/\___/_/ /_/ /_/ .___/
/_/
\033[0m'
echo -e "\033[35;1mLEMP server (Nginx Mysql Php-fpm) \033[0m"
\033[0m\n'
printf "\033[35;1mLEMP server (Nginx Mysql Php-fpm) \033[0m\n"
if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root"
@@ -29,22 +29,22 @@ fi
sleep 2
echo -e '\033[35m
printf '\033[35m
____ __ ______
/ __ \/ / / / __ \
/ /_/ / /_/ / /_/ /
/ ____/ __ / ____/
/_/ /_/ /_/_/
\033[0m'
\033[0m\n'
echo -e "\033[35;1mInstalling SURY \033[0m"
printf "\033[35;1mInstalling SURY \033[0m\n"
sleep 3
apt-get --yes install ca-certificates apt-transport-https software-properties-common curl lsb-release
curl -sSL https://packages.sury.org/php/README.txt | bash -x
apt-get update && apt-get --yes upgrade
echo -e "\033[35;1mInstalling PHP \033[0m"
printf "\033[35;1mInstalling PHP \033[0m\n"
sleep 3
@@ -88,17 +88,17 @@ systemctl start php${PHP_VERSION}-fpm
#
# systemctl start memcached
echo -e "\033[92;1mphp installed\033[Om"
printf "\033[92;1mphp installed\033[Om\n"
echo -e '\033[35m
printf '\033[35m
_ __ _
/ | / /___ _(_)___ _ __
/ |/ / __ `/ / __ \| |/_/
/ /| / /_/ / / / / /> <
/_/ |_/\__, /_/_/ /_/_/|_|
/____/
\033[0m'
echo -e "\033[35;1mInstalling Nginx \033[0m"
\033[0m\n'
printf "\033[35;1mInstalling Nginx \033[0m\n"
sleep 3
apt-get --yes install nginx
mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.ori
@@ -107,7 +107,7 @@ sed -i "s/PHP_FPM_SOCK/php${PHP_VERSION}-fpm.sock/g" /etc/nginx/sites-available/
systemctl enable nginx
systemctl restart nginx
echo -e "\033[92;1mNginx installed\033[Om"
printf "\033[92;1mNginx installed\033[Om\n"
@@ -119,15 +119,15 @@ read installmysql
done
if [ "$installmysql" = "yes" ]; then
echo -e '\033[35m
printf '\033[35m
__ ___ __
/ |/ /_ ___________ _/ /
/ /|_/ / / / / ___/ __ `/ /
/ / / / /_/ (__ ) /_/ / /
/_/ /_/\__, /____/\__, /_/
/____/ /_/
\033[0m'
echo -e "\033[35;1minstalling Mysql \033[0m"
\033[0m\n'
printf "\033[35;1minstalling Mysql \033[0m\n"
sleep 3
apt-get --yes install mariadb-server
mysql_secure_installation
@@ -139,17 +139,17 @@ if [ "$installmysql" = "yes" ]; then
systemctl enable mariadb.service
systemctl restart mariadb.service
echo -e "\033[92;1mmysql installed\033[Om"
printf "\033[92;1mmysql installed\033[Om\n"
echo -e '\033[35m
printf '\033[35m
__ __ ___ ___ __ _
____ / /_ ____ / |/ /_ __/ | ____/ /___ ___ (_)___
/ __ \/ __ \/ __ \/ /|_/ / / / / /| |/ __ / __ `__ \/ / __ \
/ /_/ / / / / /_/ / / / / /_/ / ___ / /_/ / / / / / / / / / /
/ .___/_/ /_/ .___/_/ /_/\__, /_/ |_\__,_/_/ /_/ /_/_/_/ /_/
/_/ /_/ /____/
\033[0m'
echo -e "\033[35;1mInstalling phpMyAdmin \033[0m"
\033[0m\n'
printf "\033[35;1mInstalling phpMyAdmin \033[0m\n"
##### Building dependency tree
##### Reading state information... Done
##### Package phpmyadmin is not available, but is referred to by another package.
@@ -166,8 +166,8 @@ if [ "$installmysql" = "yes" ]; then
cp "$_assets"/nginx-phpmyadmin.conf /etc/nginx/sites-available/phpmyadmin.conf
sed -i "s/PHP_FPM_SOCK/php${PHP_VERSION}-fpm.sock/g" /etc/nginx/sites-available/phpmyadmin.conf
echo -e "\033[92;1mphpMyAdmin installed\033[Om"
echo -e "\033[92;1mYou can access it at yourip/phpmyadmin\033[Om"
printf "\033[92;1mphpMyAdmin installed\033[Om\n"
printf "\033[92;1mYou can access it at yourip/phpmyadmin\033[Om\n"
# install from source
# apt-get --yes install php-{mbstring,zip,gd,xml,pear,gettext,cgi}
@@ -178,21 +178,21 @@ if [ "$installmysql" = "yes" ]; then
# rm phpMyAdmin-latest-all-languages.zip
# # cp "$_assets"/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf
# # ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf
# echo -e "\033[92;1mphpMyAdmin installed\033[Om"
# echo -e "\033[92;1mYou can access it at yourip/pma\033[Om"
# printf "\033[92;1mphpMyAdmin installed\033[Om\n"
# printf "\033[92;1mYou can access it at yourip/pma\033[Om\n"
fi
echo -e '\033[35m
printf '\033[35m
____ ___
/ __ \___ ____/ (_)____
/ /_/ / _ \/ __ / / ___/
/ _, _/ __/ /_/ / (__ )
/_/ |_|\___/\__,_/_/____/
\033[0m'
echo -e "\033[35;1mInstalling Redis \033[0m"
\033[0m\n'
printf "\033[35;1mInstalling Redis \033[0m\n"
sleep 3
apt-get --yes install redis-server php${PHP_VERSION}-redis
@@ -209,34 +209,34 @@ apt-get --yes install redis-server php${PHP_VERSION}-redis
systemctl enable redis-server
systemctl restart redis-server
systemctl restart php${PHP_VERSION}-fpm
echo -e "\033[92;1mRedis installed\033[Om"
printf "\033[92;1mRedis installed\033[Om\n"
echo -e '\033[35m
printf '\033[35m
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
\033[0m'
echo -e "\033[35;1mInstalling Composer \033[0m"
\033[0m\n'
printf "\033[35;1mInstalling Composer \033[0m\n"
sleep 3
export COMPOSER_HOME=/usr/local/composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
echo -e "\033[92;1mComposer installed\033[Om"
printf "\033[92;1mComposer installed\033[Om\n"
echo -e '\033[35m
printf '\033[35m
____ __
/ __ \_______ _______/ /_
/ / / / ___/ / / / ___/ __ \
/ /_/ / / / /_/ (__ ) / / /
/_____/_/ \__,_/____/_/ /_/
\033[0m'
echo -e "\033[35;1mInstalling Drush\033[0m"
\033[0m\n'
printf "\033[35;1mInstalling Drush\033[0m\n"
sleep 3
# curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar -L -o /usr/local/bin/drush
wget -O /usr/local/bin/drush https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar
chmod +x /usr/local/bin/drush
echo -e "\033[92;1mDrush\033[Om"
printf "\033[92;1mDrush\033[Om\n"