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
+10 -10
View File
@@ -4,14 +4,14 @@
# TODO check if root # TODO check if root
echo -e '\033[35m printf '\033[35m
__ _______ __________ __ _______ __________
/ / / / ___// ____/ __ \ / / / / ___// ____/ __ \
/ / / /\__ \/ __/ / /_/ / / / / /\__ \/ __/ / /_/ /
/ /_/ /___/ / /___/ _, _/ / /_/ /___/ / /___/ _, _/
\____//____/_____/_/ |_| \____//____/_____/_/ |_|
\033[0m' \033[0m\n'
echo -e "\033[35;1mCreate new user (you will be asked a user name and a password) \033[0m" printf "\033[35;1mCreate new user (you will be asked a user name and a password) \033[0m\n"
sleep 3 sleep 3
while [ "$user" = "" ] while [ "$user" = "" ]
do do
@@ -34,14 +34,14 @@ mkdir /home/$user/backups
chmod -w /home/"$user" chmod -w /home/"$user"
echo -e '\033[35m printf '\033[35m
__ __ __ __
_ __/ /_ ____ _____/ /_ _ __/ /_ ____ _____/ /_
| | / / __ \/ __ \/ ___/ __/ | | / / __ \/ __ \/ ___/ __/
| |/ / / / / /_/ (__ ) /_ | |/ / / / / /_/ (__ ) /_
|___/_/ /_/\____/____/\__/ |___/_/ /_/\____/____/\__/
\033[0m' \033[0m\n'
echo -e "\033[35;1mVHOST install \033[0m" printf "\033[35;1mVHOST install \033[0m\n"
while [ "$_host_name" = "" ] while [ "$_host_name" = "" ]
do do
@@ -75,20 +75,20 @@ ln -s /home/"$user"/logs /var/www/"$_host_name"/logs
# a2ensite "$_host_name".conf # a2ensite "$_host_name".conf
#restart apache #restart apache
# service apache2 restart # 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 # todo add mysql user and database
echo -e '\033[35m printf '\033[35m
__ ___ __ __ ___ __
/ |/ /_ ___________ _/ / / |/ /_ ___________ _/ /
/ /|_/ / / / / ___/ __ `/ / / /|_/ / / / / ___/ __ `/ /
/ / / / /_/ (__ ) /_/ / / / / / / /_/ (__ ) /_/ / /
/_/ /_/\__, /____/\__, /_/ /_/ /_/\__, /____/\__, /_/
/____/ /_/ /____/ /_/
\033[0m' \033[0m\n'
echo -e "\033[35;1mMysql database \033[0m" printf "\033[35;1mMysql database \033[0m\n"
while [ "$_dbname" = "" ] while [ "$_dbname" = "" ]
do do
+4 -4
View File
@@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
___ __ __ __ __ __ ___ __ __ __ __ __
/ | __ __/ /_____ / / / /___ ____/ /___ _/ /____ / | __ __/ /_____ / / / /___ ____/ /___ _/ /____
/ /| |/ / / / __/ __ \ / / / / __ \/ __ / __ `/ __/ _ \ / /| |/ / / / __/ __ \ / / / / __ \/ __ / __ `/ __/ _ \
/ ___ / /_/ / /_/ /_/ / / /_/ / /_/ / /_/ / /_/ / /_/ __/ / ___ / /_/ / /_/ /_/ / / /_/ / /_/ / /_/ / /_/ / /_/ __/
/_/ |_\__,_/\__/\____/ \____/ .___/\__,_/\__,_/\__/\___/ /_/ |_\__,_/\__/\____/ \____/ .___/\__,_/\__,_/\__/\___/
/_/ /_/
\033[0m' \033[0m\n'
# https://www.howtoforge.com/how-to-configure-automatic-updates-on-debian-wheezy # https://www.howtoforge.com/how-to-configure-automatic-updates-on-debian-wheezy
# https://www.bisolweb.com/tutoriels/serveur-vps-ovh-partie-5-installation-apticron/ # https://www.bisolweb.com/tutoriels/serveur-vps-ovh-partie-5-installation-apticron/
@@ -16,7 +16,7 @@ if [ "$(id -u)" -ne 0 ]; then
exit exit
fi fi
echo -e "\033[35;1mInstalling apticron \033[0m" printf "\033[35;1mInstalling apticron \033[0m\n"
apt-get --yes install apticron apt-get --yes install apticron
sleep 3 sleep 3
@@ -27,4 +27,4 @@ sed -i -r "s/EMAIL=\"root\"/EMAIL=\"$email\"/g" /etc/apticron/apticron.conf
# sed -i -r "s/# DIFF_ONLY=\"1\"/DIFF_ONLY=\"1\"/g" /etc/apticron/apticron.conf # sed -i -r "s/# DIFF_ONLY=\"1\"/DIFF_ONLY=\"1\"/g" /etc/apticron/apticron.conf
sed -i -r "s/# NOTIFY_NEW=\"0\"/NOTIFY_NEW=\"0\"/g" /etc/apticron/apticron.conf sed -i -r "s/# NOTIFY_NEW=\"0\"/NOTIFY_NEW=\"0\"/g" /etc/apticron/apticron.conf
echo -e "\033[92;1mApticron installed and configured\033[0m" printf "\033[92;1mApticron installed and configured\033[0m\n"
+4 -4
View File
@@ -1,14 +1,14 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
____ __ _______ __ ____ __ _______ __
/ __ \____ / /_ / ____(_) /__ _____ / __ \____ / /_ / ____(_) /__ _____
/ / / / __ \/ __/ / /_ / / / _ \/ ___/ / / / / __ \/ __/ / /_ / / / _ \/ ___/
/ /_/ / /_/ / /_ / __/ / / / __(__ ) / /_/ / /_/ / /_ / __/ / / / __(__ )
/_____/\____/\__/ /_/ /_/_/\___/____/ /_____/\____/\__/ /_/ /_/_/\___/____/
\033[0m' \033[0m\n'
#installing better prompt and some goodies #installing better prompt and some goodies
echo -e "\033[35;1mInstalling shell prompt for current user $USER \033[0m" printf "\033[35;1mInstalling shell prompt for current user $USER \033[0m\n"
sleep 2 sleep 2
# get the current position # get the current position
_cwd="$(pwd)" _cwd="$(pwd)"
@@ -19,4 +19,4 @@ git clone https://figureslibres.io/gitea/bachir/dotfiles-server.git ~/.dotfiles-
source ~/.bashrc source ~/.bashrc
# return to working directory # return to working directory
cd "$_cwd" cd "$_cwd"
echo -e "\033[92;1mDot files installed for $USER\033[0m" printf "\033[92;1mDot files installed for $USER\033[0m\n"
+5 -5
View File
@@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
__ ______ ______ __ ______ ______
/ |/ / | / _/ / / |/ / | / _/ /
/ /|_/ / /| | / // / / /|_/ / /| | / // /
/ / / / ___ |_/ // /___ / / / / ___ |_/ // /___
/_/ /_/_/ |_/___/_____/ /_/ /_/_/ |_/___/_____/
\033[0m' \033[0m\n'
echo -e "\033[35;1mEnable mail sending for php \033[0m" printf "\033[35;1mEnable mail sending for php \033[0m\n"
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -29,7 +29,7 @@ fi
# http://www.sycha.com/lamp-setup-debian-linux-apache-mysql-php#anchor13 # http://www.sycha.com/lamp-setup-debian-linux-apache-mysql-php#anchor13
sleep 2 sleep 2
apt-get --yes install exim4 apt-get --yes install exim4
echo -e "\033[35;1mConfiguring EXIM4 \033[0m" printf "\033[35;1mConfiguring EXIM4 \033[0m\n"
while [ "$configexim" != "y" ] && [ "$configexim" != "n" ] while [ "$configexim" != "y" ] && [ "$configexim" != "n" ]
do do
echo -n "Should we configure exim4 ? [y|n] " echo -n "Should we configure exim4 ? [y|n] "
@@ -48,7 +48,7 @@ systemctl restart exim4
# dkim spf # dkim spf
# https://debian-administration.org/article/718/DKIM-signing_outgoing_mail_with_exim4 # https://debian-administration.org/article/718/DKIM-signing_outgoing_mail_with_exim4
echo -e "\033[35;1mConfiguring DKIM \033[0m" printf "\033[35;1mConfiguring DKIM \033[0m\n"
while [ "$installdkim" != "y" ] && [ "$installdkim" != "n" ] while [ "$installdkim" != "y" ] && [ "$installdkim" != "n" ]
do do
echo -n "Should we install dkim for exim4 ? [y|n] " echo -n "Should we install dkim for exim4 ? [y|n] "
+4 -4
View File
@@ -2,14 +2,14 @@
# TODO check if root # TODO check if root
echo -e '\033[35m printf '\033[35m
______ _ _____ __ ______ _ _____ __
/ ____/___ _(_) /__ \ / /_ ____ _____ / ____/___ _(_) /__ \ / /_ ____ _____
/ /_ / __ `/ / /__/ // __ \/ __ `/ __ \ / /_ / __ `/ / /__/ // __ \/ __ `/ __ \
/ __/ / /_/ / / // __// /_/ / /_/ / / / / / __/ / /_/ / / // __// /_/ / /_/ / / / /
/_/ \__,_/_/_//____/_.___/\__,_/_/ /_/ /_/ \__,_/_/_//____/_.___/\__,_/_/ /_/
\033[0m' \033[0m\n'
echo -e "\033[35;1mInstalling fall2ban \033[0m" printf "\033[35;1mInstalling fall2ban \033[0m\n"
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -23,4 +23,4 @@ cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
touch /var/log/auth.log touch /var/log/auth.log
systemctl enable fail2ban systemctl enable fail2ban
systemctl restart fail2ban systemctl restart fail2ban
echo -e "\033[92;1mfail2ban installed and configured\033[Om" printf "\033[92;1mfail2ban installed and configured\033[Om\n"
+4 -4
View File
@@ -2,14 +2,14 @@
# TODO check if root # TODO check if root
echo -e '\033[35m printf '\033[35m
______________ _______ _____ __ __ ______________ _______ _____ __ __
/ ____/ _/ __ \/ ____/ | / / | / / / / / ____/ _/ __ \/ ____/ | / / | / / / /
/ /_ / // /_/ / __/ | | /| / / /| | / / / / / /_ / // /_/ / __/ | | /| / / /| | / / / /
/ __/ _/ // _, _/ /___ | |/ |/ / ___ |/ /___/ /___ / __/ _/ // _, _/ /___ | |/ |/ / ___ |/ /___/ /___
/_/ /___/_/ |_/_____/ |__/|__/_/ |_/_____/_____/ /_/ /___/_/ |_/_____/ |__/|__/_/ |_/_____/_____/
\033[0m' \033[0m\n'
echo -e "\033[35;1mInstalling ufw and setup firewall (allowing only ssh and http) \033[0m" printf "\033[35;1mInstalling ufw and setup firewall (allowing only ssh and http) \033[0m\n"
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -26,4 +26,4 @@ ufw allow https
ufw enable ufw enable
ufw status verbose ufw status verbose
echo -e "\033[92;1mufw installed and firwall configured\033[Om" printf "\033[92;1mufw installed and firwall configured\033[Om\n"
+2 -2
View File
@@ -1,14 +1,14 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
______ _______ _____ ______ _______ _____
| ____|__ __| __ \ | ____|__ __| __ \
| |__ | | | |__) | | |__ | | | |__) |
| __| | | | ___/ | __| | | | ___/
| | | | | | | | | | | |
|_| |_| |_| |_| |_| |_|
\033[0m' \033[0m\n'
if [ "$(id -u)" -ne 0 ] if [ "$(id -u)" -ne 0 ]
then echo "Please run as root" then echo "Please run as root"
+3 -3
View File
@@ -4,14 +4,14 @@
# get the current position # get the current position
_cwd="$(pwd)" _cwd="$(pwd)"
echo -e '\033[35m printf '\033[35m
_______ __ _______ __
/ ____(_) /_ / ____(_) /_
/ / __/ / __/ / / __/ / __/
/ /_/ / / /_ / /_/ / / /_
\____/_/\__/ \____/_/\__/
\033[0m' \033[0m\n'
echo -e "\033[35;1mCreate new git barre repos and deploy script\033[0m" printf "\033[35;1mCreate new git barre repos and deploy script\033[0m\n"
echo "Git barre repo will be installed in chosen user home directory" echo "Git barre repo will be installed in chosen user home directory"
echo "git prod repos will be installed in public_html directory of provided domain, the domain have to exists as shortcut in chosen user/www before running this script. Please run first vhost.sh script and say yes to the question create a shortcut !" echo "git prod repos will be installed in public_html directory of provided domain, the domain have to exists as shortcut in chosen user/www before running this script. Please run first vhost.sh script and say yes to the question create a shortcut !"
+5 -5
View File
@@ -2,14 +2,14 @@
# TODO check if root # TODO check if root
echo -e '\033[35m printf '\033[35m
__ __ __ __ __ __
/ /______ ____ _____/ /______/ / / /______ ____ _____/ /______/ /
/ //_/ __ \/ __ \/ ___/ //_/ __ / / //_/ __ \/ __ \/ ___/ //_/ __ /
/ ,< / / / / /_/ / /__/ ,< / /_/ / / ,< / / / / /_/ / /__/ ,< / /_/ /
/_/|_/_/ /_/\____/\___/_/|_|\__,_/ /_/|_/_/ /_/\____/\___/_/|_|\__,_/
\033[0m' \033[0m\n'
echo -e "\033[35;1mInstalling knockd to control ssh port opening\033[0m" printf "\033[35;1mInstalling knockd to control ssh port opening\033[0m\n"
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -50,7 +50,7 @@ Alias=knockd.service" >> /lib/systemd/system/knockd.service
systemctl enable knockd systemctl enable knockd
systemctl start knockd systemctl start knockd
echo -e "\033[92;1mknockd installed and configured\033[Om" printf "\033[92;1mknockd installed and configured\033[Om\n"
echo -e "\033[92;1mplease note this sequence for future ssh knocking\033[Om" printf "\033[92;1mplease note this sequence for future ssh knocking\033[Om\n"
echo "$sq" echo "$sq"
sleep 3 sleep 3
+35 -35
View File
@@ -1,14 +1,14 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
__ __
/ /__ ____ ___ ____ / /__ ____ ___ ____
/ / _ \/ __ `__ \/ __ \ / / _ \/ __ `__ \/ __ \
/ / __/ / / / / / /_/ / / / __/ / / / / / /_/ /
/_/\___/_/ /_/ /_/ .___/ /_/\___/_/ /_/ /_/ .___/
/_/ /_/
\033[0m' \033[0m\n'
echo -e "\033[35;1mLEMP server (Nginx Mysql Php-fpm) \033[0m" printf "\033[35;1mLEMP server (Nginx Mysql Php-fpm) \033[0m\n"
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -29,22 +29,22 @@ fi
sleep 2 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 sleep 3
apt-get --yes install ca-certificates apt-transport-https software-properties-common curl lsb-release 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 curl -sSL https://packages.sury.org/php/README.txt | bash -x
apt-get update && apt-get --yes upgrade 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 sleep 3
@@ -88,17 +88,17 @@ systemctl start php${PHP_VERSION}-fpm
# #
# systemctl start memcached # 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' \033[0m\n'
echo -e "\033[35;1mInstalling Nginx \033[0m" printf "\033[35;1mInstalling Nginx \033[0m\n"
sleep 3 sleep 3
apt-get --yes install nginx apt-get --yes install nginx
mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.ori 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 enable nginx
systemctl restart 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 done
if [ "$installmysql" = "yes" ]; then if [ "$installmysql" = "yes" ]; then
echo -e '\033[35m printf '\033[35m
__ ___ __ __ ___ __
/ |/ /_ ___________ _/ / / |/ /_ ___________ _/ /
/ /|_/ / / / / ___/ __ `/ / / /|_/ / / / / ___/ __ `/ /
/ / / / /_/ (__ ) /_/ / / / / / / /_/ (__ ) /_/ / /
/_/ /_/\__, /____/\__, /_/ /_/ /_/\__, /____/\__, /_/
/____/ /_/ /____/ /_/
\033[0m' \033[0m\n'
echo -e "\033[35;1minstalling Mysql \033[0m" printf "\033[35;1minstalling Mysql \033[0m\n"
sleep 3 sleep 3
apt-get --yes install mariadb-server apt-get --yes install mariadb-server
mysql_secure_installation mysql_secure_installation
@@ -139,17 +139,17 @@ if [ "$installmysql" = "yes" ]; then
systemctl enable mariadb.service systemctl enable mariadb.service
systemctl restart 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' \033[0m\n'
echo -e "\033[35;1mInstalling phpMyAdmin \033[0m" printf "\033[35;1mInstalling phpMyAdmin \033[0m\n"
##### Building dependency tree ##### Building dependency tree
##### Reading state information... Done ##### Reading state information... Done
##### Package phpmyadmin is not available, but is referred to by another package. ##### 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 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 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" printf "\033[92;1mphpMyAdmin installed\033[Om\n"
echo -e "\033[92;1mYou can access it at yourip/phpmyadmin\033[Om" printf "\033[92;1mYou can access it at yourip/phpmyadmin\033[Om\n"
# install from source # install from source
# apt-get --yes install php-{mbstring,zip,gd,xml,pear,gettext,cgi} # 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 # rm phpMyAdmin-latest-all-languages.zip
# # cp "$_assets"/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf # # 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 # # ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf
# echo -e "\033[92;1mphpMyAdmin installed\033[Om" # printf "\033[92;1mphpMyAdmin installed\033[Om\n"
# echo -e "\033[92;1mYou can access it at yourip/pma\033[Om" # printf "\033[92;1mYou can access it at yourip/pma\033[Om\n"
fi fi
echo -e '\033[35m printf '\033[35m
____ ___ ____ ___
/ __ \___ ____/ (_)____ / __ \___ ____/ (_)____
/ /_/ / _ \/ __ / / ___/ / /_/ / _ \/ __ / / ___/
/ _, _/ __/ /_/ / (__ ) / _, _/ __/ /_/ / (__ )
/_/ |_|\___/\__,_/_/____/ /_/ |_|\___/\__,_/_/____/
\033[0m' \033[0m\n'
echo -e "\033[35;1mInstalling Redis \033[0m" printf "\033[35;1mInstalling Redis \033[0m\n"
sleep 3 sleep 3
apt-get --yes install redis-server php${PHP_VERSION}-redis 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 enable redis-server
systemctl restart redis-server systemctl restart redis-server
systemctl restart php${PHP_VERSION}-fpm 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' \033[0m\n'
echo -e "\033[35;1mInstalling Composer \033[0m" printf "\033[35;1mInstalling Composer \033[0m\n"
sleep 3 sleep 3
export COMPOSER_HOME=/usr/local/composer export COMPOSER_HOME=/usr/local/composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=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' \033[0m\n'
echo -e "\033[35;1mInstalling Drush\033[0m" printf "\033[35;1mInstalling Drush\033[0m\n"
sleep 3 sleep 3
# curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar -L -o /usr/local/bin/drush # 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 wget -O /usr/local/bin/drush https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar
chmod +x /usr/local/bin/drush chmod +x /usr/local/bin/drush
echo -e "\033[92;1mDrush\033[Om" printf "\033[92;1mDrush\033[Om\n"
+3 -3
View File
@@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
__ ____ __ ____
/ |/ (_)_________ / |/ (_)_________
/ /|_/ / / ___/ ___/ / /|_/ / / ___/ ___/
/ / / / (__ ) /__ / / / / (__ ) /__
/_/ /_/_/____/\___/ /_/ /_/_/____/\___/
\033[0m' \033[0m\n'
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -28,4 +28,4 @@ apt-get --yes install tmux etckeeper needrestart htop lynx unzip nfs-common
echo -e "\033[92;1mMisc done \033[Om" printf "\033[92;1mMisc done \033[Om\n"
+3 -3
View File
@@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
echo -e ' printf '
_ _ _ _ _ _ _ _
__| | |__ | | | |___ ___ _ _ __| | |__ | | | |___ ___ _ _
/ _` | _ \ | |_| (_-</ -_) _| / _` | _ \ | |_| (_-</ -_) _|
\__,_|_.__/ \___//__/\___|_| \__,_|_.__/ \___//__/\___|_|
' \n'
echo -e "Create new mysql db and user (you will be asked a db name and a password)" printf "Create new mysql db and user (you will be asked a db name and a password)\n"
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
+2 -2
View File
@@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
__ __ _ ___ _ __ __ _ ___ _
| \/ |_ _ ___ __ _| | | _ ) __ _ __| |___ _ _ __ ___ | \/ |_ _ ___ __ _| | | _ ) __ _ __| |___ _ _ __ ___
| |\/| | || (_-</ _ | | | _ \/ _ / _| / / || | _ (_-< | |\/| | || (_-</ _ | | | _ \/ _ / _| / / || | _ (_-<
|_| |_|\_, /__/\__, |_| |___/\__,_\__|_\_\\_,_| .__/__/ |_| |_|\_, /__/\__, |_| |___/\__,_\__|_\_\\_,_| .__/__/
|__/ |_| |_| |__/ |_| |_|
\033[0m' \033[0m\n'
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
+3 -3
View File
@@ -1,14 +1,14 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
__ __
_ __ / _|___ _ __ / _|___
| _ \| |_/ __| | _ \| |_/ __|
| | | | _\__ \ | | | | _\__ \
|_| |_|_| |___/ |_| |_|_| |___/
\033[0m' \033[0m\n'
echo -e "\033[35;1mLEMP server (Nginx Mysql Php-fpm) \033[0m" printf "\033[35;1mLEMP server (Nginx Mysql Php-fpm) \033[0m\n"
apt install nfs-kernel-server apt install nfs-kernel-server
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
echo -e "\033[35;1mInstalling PHP 7.4 \033[0m" printf "\033[35;1mInstalling PHP 7.4 \033[0m\n"
apt-get -y install lsb-release apt-transport-https ca-certificates apt-get -y install lsb-release apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
@@ -13,4 +13,4 @@ cp "$_assets"/php7.4-fpm.ini /etc/php/7.4/fpm/php.ini
systemctl enable php7.4-fpm systemctl enable php7.4-fpm
systemctl start php7.4-fpm systemctl start php7.4-fpm
echo -e "\033[92;1mphp7.4-fpm installed\033[O" printf "\033[92;1mphp7.4-fpm installed\033[O\n"
+2 -2
View File
@@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
___ _ ___ ___ _ ___ _ ___ _ ___ ___ _ ___ _
| _ \___ __| |_ __ _ _ _ ___/ __|/ _ \| | | _ ) __ _ __| |___ _ _ __ | _ \___ __| |_ __ _ _ _ ___/ __|/ _ \| | | _ ) __ _ __| |___ _ _ __
| _/ _ (_-< _/ _. | ._/ -_)__ \ (_) | |__ | _ \/ _. / _| / / || | ._ \ | _/ _ (_-< _/ _. | ._/ -_)__ \ (_) | |__ | _ \/ _. / _| / / || | ._ \
|_| \___/__/\__\__, |_| \___|___/\__\_\____| |___/\__,_\__|_\_\\_,_| .__/ |_| \___/__/\__\__, |_| \___|___/\__\_\____| |___/\__,_\__|_\_\\_,_| .__/
|___/ |_| |___/ |_|
\033[0m' \033[0m\n'
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
+3 -3
View File
@@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
__________ __ __ __________ __ __
/ ___/ ___// / / / / ___/ ___// / / /
\__ \\__ \/ /_/ / \__ \\__ \/ /_/ /
___/ /__/ / __ / ___/ /__/ / __ /
/____/____/_/ /_/ /____/____/_/ /_/
\033[0m' \033[0m\n'
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -23,4 +23,4 @@ echo "PermitRootLogin no" >> /etc/ssh/sshd_config.d/custom.conf
echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config.d/custom.conf echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config.d/custom.conf
systemctl reload ssh systemctl reload ssh
echo -e "\033[92;1mSSH secured\033[Om" printf "\033[92;1mSSH secured\033[Om\n"
+2 -2
View File
@@ -2,13 +2,13 @@
# TODO check if root # TODO check if root
echo -e '\033[35m printf '\033[35m
__ ______ __________ ___ ____ ______ __ ______ __________ ___ ____ ______
/ / / / __ \/ ____/ __ \/ | / __ \/ ____/ / / / / __ \/ ____/ __ \/ | / __ \/ ____/
/ / / / /_/ / / __/ /_/ / /| | / / / / __/ / / / / /_/ / / __/ /_/ / /| | / / / / __/
/ /_/ / ____/ /_/ / _, _/ ___ |/ /_/ / /___ / /_/ / ____/ /_/ / _, _/ ___ |/ /_/ / /___
\____/_/ \____/_/ |_/_/ |_/_____/_____/ \____/_/ \____/_/ |_/_/ |_/_____/_____/
\033[0m' \033[0m\n'
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
+2 -2
View File
@@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
_ _ _ _ ___ _ _ _ _ _ _ _ ___ _ _ _
| | | |_ _| |__ __ _ __| |___ _ _ __ / __| | (_)___ _ _| |_ | | | |_ _| |__ __ _ __| |___ _ _ __ / __| | (_)___ _ _| |_
| |_| | _| _ \/ _` / _| / / || | _ \ | (__| |__| / -_) \ _| | |_| | _| _ \/ _` / _| / / || | _ \ | (__| |__| / -_) \ _|
\___/|_| |_.__/\__,_\__|_\_\\_,_| .__/ \___|____|_\___|_||_\__| \___/|_| |_.__/\__,_\__|_\_\\_,_| .__/ \___|____|_\___|_||_\__|
|_| |_|
\033[0m' \033[0m\n'
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
+4 -4
View File
@@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
__ _______ __________ __ _______ __________
/ / / / ___// ____/ __ \ / / / / ___// ____/ __ \
/ / / /\__ \/ __/ / /_/ / / / / /\__ \/ __/ / /_/ /
/ /_/ /___/ / /___/ _, _/ / /_/ /___/ / /___/ _, _/
\____//____/_____/_/ |_| \____//____/_____/_/ |_|
\033[0m' \033[0m\n'
echo -e "\033[35;1mCreate new user (you will be asked a user name and a password) \033[0m" printf "\033[35;1mCreate new user (you will be asked a user name and a password) \033[0m\n"
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -43,4 +43,4 @@ groupadd admin
usermod -a -G admin "$user" usermod -a -G admin "$user"
# allow admin group to su # allow admin group to su
dpkg-statoverride --update --add root admin 4750 /bin/su dpkg-statoverride --update --add root admin 4750 /bin/su
echo -e "\033[92;1muser $user configured\033[Om" printf "\033[92;1muser $user configured\033[Om\n"
+5 -5
View File
@@ -1,12 +1,12 @@
echo -e '\033[35m printf '\033[35m
__ __ __ __
_ __/ /_ ____ _____/ /_ _ __/ /_ ____ _____/ /_
| | / / __ \/ __ \/ ___/ __/ | | / / __ \/ __ \/ ___/ __/
| |/ / / / / /_/ (__ ) /_ | |/ / / / / /_/ (__ ) /_
|___/_/ /_/\____/____/\__/ |___/_/ /_/\____/____/\__/
\033[0m' \033[0m\n'
echo -e "\033[35;1mNginx VHOST install \033[0m" printf "\033[35;1mNginx VHOST install \033[0m\n"
while [ "$vh" != "y" ] && [ "$vh" != "n" ] while [ "$vh" != "y" ] && [ "$vh" != "n" ]
do do
echo -n "Should we install a vhost? [y|n] " echo -n "Should we install a vhost? [y|n] "
@@ -53,7 +53,7 @@ if [ "$vh" = "y" ]; then
_letsencrypt="" _letsencrypt=""
while [ "$_letsencrypt" != "yes" ] && [ "$_letsencrypt" != "no" ] while [ "$_letsencrypt" != "yes" ] && [ "$_letsencrypt" != "no" ]
do 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 "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] " echo -n "Should we install let's encrypt certificate with $_domain? [yes|no] "
read _letsencrypt read _letsencrypt
@@ -162,7 +162,7 @@ if [ "$vh" = "y" ]; then
# restart nginx # restart nginx
systemctl restart nginx systemctl restart nginx
echo -e "\033[92;1mvhost $_domain configured \033[Om" printf "\033[92;1mvhost $_domain configured \033[Om\n"
else else
echo "Vhost installation aborted" echo "Vhost installation aborted"
fi fi
+2 -2
View File
@@ -5,12 +5,12 @@
# get the current position # get the current position
_cwd="$(pwd)" _cwd="$(pwd)"
echo -e '\033[35m printf '\033[35m
__ __ _ _ _ _ __ __ _ _ _ _
\ \ / /__| |__| || |___ ___| |__ \ \ / /__| |__| || |___ ___| |__
\ \/\/ / -_) `_ \ __ / _ \/ _ \ / / \ \/\/ / -_) `_ \ __ / _ \/ _ \ / /
\_/\_/\___|_.__/_||_\___/\___/_\_\ \_/\_/\___|_.__/_||_\___/\___/_\_\
\033[0m' \033[0m\n'
# check for assets folder # check for assets folder
_assets="$_cwd/assets" _assets="$_cwd/assets"
+5 -5
View File
@@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
echo -e '\033[35m printf '\033[35m
_____ __ __ _ _____ __ __ _
/__ / ____ _/ /_ / /_ (_) __ /__ / ____ _/ /_ / /_ (_) __
/ / / __ `/ __ \/ __ \/ / |/_/ / / / __ `/ __ \/ __ \/ / |/_/
/ /__/ /_/ / /_/ / /_/ / /> < / /__/ /_/ / /_/ / /_/ / /> <
/____/\__,_/_.___/_.___/_/_/|_| /____/\__,_/_.___/_.___/_/_/|_|
\033[0m' \033[0m\n'
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -134,6 +134,6 @@ ufw allow from "$_ip" to any port 22
systemctl restart zabbix-agent systemctl restart zabbix-agent
systemctl enable zabbix-agent systemctl enable zabbix-agent
echo -e "\033[92;1mZabbix-agent installed and configured, please add the host $_host_name in your zabbix-server \033[Om" printf "\033[92;1mZabbix-agent installed and configured, please add the host $_host_name in your zabbix-server \033[Om\n"
echo -e "\033[92;1mAnd import requested templates in assets/zabbix/templates/ \033[Om" printf "\033[92;1mAnd import requested templates in assets/zabbix/templates/ \033[Om\n"
echo -e "\033[92;1mzabbix user mysql password is $_passwd \033[Om" printf "\033[92;1mzabbix user mysql password is $_passwd \033[Om\n"
+10 -10
View File
@@ -5,15 +5,15 @@
# http://web-74.com/blog/reseaux/gerer-le-deploiement-facilement-avec-git/ # http://web-74.com/blog/reseaux/gerer-le-deploiement-facilement-avec-git/
# #
echo -e '\033[35m printf '\033[35m
____ __ _ _____ ____ __ _ _____
/ __ \___ / /_ (_)___ _____ / ___/___ ______ _____ _____ / __ \___ / /_ (_)___ _____ / ___/___ ______ _____ _____
/ / / / _ \/ __ \/ / __ `/ __ \ \__ \/ _ \/ ___/ | / / _ \/ ___/ / / / / _ \/ __ \/ / __ `/ __ \ \__ \/ _ \/ ___/ | / / _ \/ ___/
/ /_/ / __/ /_/ / / /_/ / / / / ___/ / __/ / | |/ / __/ / / /_/ / __/ /_/ / / /_/ / / / / ___/ / __/ / | |/ / __/ /
/_____/\___/_.___/_/\__,_/_/ /_/ /____/\___/_/ |___/\___/_/ /_____/\___/_.___/_/\__,_/_/ /_/ /____/\___/_/ |___/\___/_/
\033[0m' \033[0m\n'
echo -e "\033[35;1mThis script has been tested only on Linux Debian 10 \033[0m" printf "\033[35;1mThis script has been tested only on Linux Debian 10 \033[0m\n"
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
@@ -111,13 +111,13 @@ fi
# . bin/autoupdate.sh # . bin/autoupdate.sh
# echo -e '\033[35m # printf '\033[35m
# ______________ _______ # ______________ _______
# /_ __/ ____/ |/ / __ \ # /_ __/ ____/ |/ / __ \
# / / / __/ / /|_/ / /_/ / # / / / __/ / /|_/ / /_/ /
# / / / /___/ / / / ____/ # / / / /___/ / / / ____/
# /_/ /_____/_/ /_/_/ # /_/ /_____/_/ /_/_/
# \033[0m' # \033[0m\n'
# function check_tmp_secured { # function check_tmp_secured {
# temp1=`grep -w "/var/tempFS /tmp ext3 loop,nosuid,noexec,rw 0 0" /etc/fstab | wc -l` # 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 # # Remove old tmp dir
# rm -rf /var/tmpbackup # 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 # } # End function secure_tmp_tmpfs
# check_tmp_secured # check_tmp_secured
# if [ $? = 0 ]; then # if [ $? = 0 ]; then
# secure_tmp_tmpfs # secure_tmp_tmpfs
# else # else
# echo -e "\033[35;1mFunction canceled. /tmp already secured. \033[0m" # printf "\033[35;1mFunction canceled. /tmp already secured. \033[0m\n"
# fi # fi
# TODO add warning message on ssh connection if system needs updates # 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' \033[0m\n'
echo -e "\033[35;1m* * script done * * \033[0m" printf "\033[35;1m* * script done * * \033[0m\n"