Browse Source

reverted for bash shell

Bachir Soussi Chiadmi 4 years ago
parent
commit
9225ca2f4b
20 changed files with 41 additions and 35 deletions
  1. 3 3
      bin/_addUserSite.sh
  2. 1 1
      bin/autoupdate.sh
  3. 1 1
      bin/dotfiles.sh
  4. 1 1
      bin/email.sh
  5. 1 1
      bin/fail2ban.sh
  6. 1 1
      bin/firewall.sh
  7. 1 1
      bin/ftp.sh
  8. 1 1
      bin/gitbarrerepos.sh
  9. 1 1
      bin/knockd.sh
  10. 10 10
      bin/lemp.sh
  11. 1 1
      bin/misc.sh
  12. 1 1
      bin/mysqlbackup.sh
  13. 1 1
      bin/ssh.sh
  14. 1 1
      bin/upgrade.sh
  15. 1 1
      bin/urbackup.sh
  16. 2 2
      bin/user.sh
  17. 1 1
      bin/vhost.sh
  18. 1 1
      bin/zabbix.sh
  19. 4 4
      install.sh
  20. 7 1
      readme.md

+ 3 - 3
bin/_addUserSite.sh

@@ -4,7 +4,7 @@
 
 # TODO check if root
 
-echo '\033[35m
+echo -e '\033[35m
    __  _______ __________
   / / / / ___// ____/ __ \
  / / / /\__ \/ __/ / /_/ /
@@ -34,7 +34,7 @@ mkdir /home/$user/backups
 
 chmod -w /home/"$user"
 
-echo '\033[35m
+echo -e '\033[35m
         __               __
  _   __/ /_  ____  _____/ /_
 | | / / __ \/ __ \/ ___/ __/
@@ -80,7 +80,7 @@ echo "\033[92;1mvhost $_host_name configured\033[Om"
 
 # todo add mysql user and database
 
-echo '\033[35m
+echo -e '\033[35m
     __  ___                 __
    /  |/  /_  ___________ _/ /
   / /|_/ / / / / ___/ __ `/ /

+ 1 - 1
bin/autoupdate.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-echo '\033[35m
+echo -e '\033[35m
     ___         __           __  __          __      __
    /   | __  __/ /_____     / / / /___  ____/ /___ _/ /____
   / /| |/ / / / __/ __ \   / / / / __ \/ __  / __ `/ __/ _ \

+ 1 - 1
bin/dotfiles.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-echo '\033[35m
+echo -e '\033[35m
     ____        __     _______ __
    / __ \____  / /_   / ____(_) /__  _____
   / / / / __ \/ __/  / /_  / / / _ \/ ___/

+ 1 - 1
bin/email.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-echo '\033[35m
+echo -e '\033[35m
     __  ______    ______
    /  |/  /   |  /  _/ /
   / /|_/ / /| |  / // /

+ 1 - 1
bin/fail2ban.sh

@@ -2,7 +2,7 @@
 
 # TODO check if root
 
-echo '\033[35m
+echo -e '\033[35m
     ______      _ _____   __
    / ____/___ _(_) /__ \ / /_  ____ _____
   / /_  / __ `/ / /__/ // __ \/ __ `/ __ \

+ 1 - 1
bin/firewall.sh

@@ -2,7 +2,7 @@
 
 # TODO check if root
 
-echo '\033[35m
+echo -e '\033[35m
     ______________  _______       _____    __    __
    / ____/  _/ __ \/ ____/ |     / /   |  / /   / /
   / /_   / // /_/ / __/  | | /| / / /| | / /   / /

+ 1 - 1
bin/ftp.sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 
 
-echo '\033[35m
+echo -e '\033[35m
   ______ _______ _____
  |  ____|__   __|  __ \
  | |__     | |  | |__) |

+ 1 - 1
bin/gitbarrerepos.sh

@@ -4,7 +4,7 @@
 # get the current position
 _cwd="$(pwd)"
 
-echo '\033[35m
+echo -e '\033[35m
    _______ __
   / ____(_) /_
  / / __/ / __/

+ 1 - 1
bin/knockd.sh

@@ -2,7 +2,7 @@
 
 # TODO check if root
 
-echo '\033[35m
+echo -e '\033[35m
     __                    __       __
    / /______  ____  _____/ /______/ /
   / //_/ __ \/ __ \/ ___/ //_/ __  /

+ 10 - 10
bin/lemp.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-echo '\033[35m
+echo -e '\033[35m
     __
    / /__  ____ ___  ____
   / / _ \/ __ `__ \/ __ \
@@ -29,7 +29,7 @@ fi
 
 sleep 2
 
-echo '\033[35m
+echo -e '\033[35m
     __  ___                 __
    /  |/  /_  ___________ _/ /
   / /|_/ / / / / ___/ __ `/ /
@@ -48,7 +48,7 @@ systemctl enable mariadb.service
 systemctl restart mariadb.service
 echo "\033[92;1mmysql installed\033[Om"
 
-echo '\033[35m
+echo -e '\033[35m
     ____  __  ______
    / __ \/ / / / __ \
   / /_/ / /_/ / /_/ /
@@ -80,7 +80,7 @@ systemctl start php7.0-fpm
 
 echo "\033[92;1mphp installed\033[Om"
 
-echo '\033[35m
+echo -e '\033[35m
     _   __      _
    / | / /___ _(_)___  _  __
   /  |/ / __ `/ / __ \| |/_/
@@ -98,7 +98,7 @@ systemctl enable nginx
 systemctl restart nginx
 echo "\033[92;1mNginx installed\033[Om"
 
-echo '\033[35m
+echo -e '\033[35m
            __          __  ___      ___       __          _
     ____  / /_  ____  /  |/  /_  __/   | ____/ /___ ___  (_)___
    / __ \/ __ \/ __ \/ /|_/ / / / / /| |/ __  / __ `__ \/ / __ \
@@ -122,7 +122,7 @@ ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmya
 echo "\033[92;1mphpMyAdmin installed\033[Om"
 echo "\033[92;1mYou can access it at yourip/phpmyadmin\033[Om"
 
-echo '\033[35m
+echo -e '\033[35m
     ____           ___
    / __ \___  ____/ (_)____
   / /_/ / _ \/ __  / / ___/
@@ -143,7 +143,7 @@ systemctl restart redis-server
 systemctl restart php7.0-fpm
 echo "\033[92;1mRedis installed\033[Om"
 
-echo '\033[35m
+echo -e '\033[35m
    ______
   / ____/___  ____ ___  ____  ____  ________  _____
  / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
@@ -159,7 +159,7 @@ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin
 echo "\033[92;1mComposer installed\033[Om"
 
 
-echo '\033[35m
+echo -e '\033[35m
     ____                  __
    / __ \_______  _______/ /_
   / / / / ___/ / / / ___/ __ \
@@ -177,7 +177,7 @@ echo "\033[92;1mDrush and DrupalConsoleinstalled\033[Om"
 
 
 # TODO supervising
-# echo '\033[35m
+# echo -e '\033[35m
 #    __  ___          _ __      __  __  ___          _
 #   /  |/  /__  ___  (_) /_   _/_/ /  |/  /_ _____  (_)__
 #  / /|_/ / _ \/ _ \/ / __/ _/_/  / /|_/ / // / _ \/ / _ \
@@ -256,7 +256,7 @@ echo "\033[92;1mDrush and DrupalConsoleinstalled\033[Om"
 # echo "\033[92;1mMonit installed\033[Om"
 
 
-# echo '\033[35m
+# echo -e '\033[35m
 #     ___                __        __
 #    /   |_      _______/ /_____ _/ /_
 #   / /| | | /| / / ___/ __/ __ `/ __/

+ 1 - 1
bin/misc.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-echo '\033[35m
+echo -e '\033[35m
     __  ____
    /  |/  (_)_________
   / /|_/ / / ___/ ___/

+ 1 - 1
bin/mysqlbackup.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-echo '\033[35m
+echo -e '\033[35m
   __  __               _   ___          _
  |  \/  |_  _ ___ __ _| | | _ ) __ _ __| |___  _ _ __ ___
  | |\/| | || (_-</ _  | | | _ \/ _  / _| / / || |  _ (_-<

+ 1 - 1
bin/ssh.sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 
 
-echo '\033[35m
+echo -e '\033[35m
    __________ __  __
   / ___/ ___// / / /
   \__ \\__ \/ /_/ /

+ 1 - 1
bin/upgrade.sh

@@ -2,7 +2,7 @@
 
 # TODO check if root
 
-echo '\033[35m
+echo -e '\033[35m
    __  ______  __________  ___    ____  ______
   / / / / __ \/ ____/ __ \/   |  / __ \/ ____/
  / / / / /_/ / / __/ /_/ / /| | / / / / __/

+ 1 - 1
bin/urbackup.sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 
 
-echo '\033[35m
+echo -e '\033[35m
   _   _     _             _                ___ _    _         _
  | | | |_ _| |__  __ _ __| |___  _ _ __   / __| |  (_)___ _ _| |_
  | |_| |  _|  _ \/ _` / _| / / || |  _ \ | (__| |__| / -_)   \  _|

+ 2 - 2
bin/user.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-echo '\033[35m
+echo -e '\033[35m
    __  _______ __________
   / / / / ___// ____/ __ \
  / / / /\__ \/ __/ / /_/ /
@@ -37,7 +37,7 @@ do
   fi
 done
 
-# TODO 
+# TODO
 # ./install.sh: 42: bin/user.sh: adduser: not found
 # adding dev to admin group and limiting su to the admin group
 # ./install.sh: 44: bin/user.sh: groupadd: not found

+ 1 - 1
bin/vhost.sh

@@ -1,5 +1,5 @@
 
-echo '\033[35m
+echo -e '\033[35m
         __               __
  _   __/ /_  ____  _____/ /_
 | | / / __ \/ __ \/ ___/ __/

+ 1 - 1
bin/zabbix.sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 
 
-echo '\033[35m
+echo -e '\033[35m
  _____         __    __    _
 /__  /  ____ _/ /_  / /_  (_)  __
   / /  / __ `/ __ \/ __ \/ / |/_/

+ 4 - 4
install.sh

@@ -5,7 +5,7 @@
 # http://web-74.com/blog/reseaux/gerer-le-deploiement-facilement-avec-git/
 #
 
-echo '\033[35m
+echo -e '\033[35m
     ____       __    _                _____
    / __ \___  / /_  (_)___ _____     / ___/___  ______   _____  _____
   / / / / _ \/ __ \/ / __ `/ __ \    \__ \/ _ \/ ___/ | / / _ \/ ___/
@@ -15,7 +15,7 @@ echo '\033[35m
 \033[0m'
 echo "\033[35;1mThis script has been tested only on Linux Debian 10 \033[0m"
 
-if [ "$EUID" -ne 0 ]; then
+if [[ $EUID -ne 0 ]]; then
   echo "Please run as root"
   exit
 fi
@@ -109,7 +109,7 @@ fi
 . bin/dotfiles.sh
 # . bin/autoupdate.sh
 
-# echo '\033[35m
+# echo -e '\033[35m
 #   ______________  _______
 #  /_  __/ ____/  |/  / __ \
 #   / / / __/ / /|_/ / /_/ /
@@ -172,7 +172,7 @@ fi
 
 
 
-echo '\033[35m
+echo -e '\033[35m
                   __
   ___  ____  ____/ /
  / _ \/ __ \/ __  /

+ 7 - 1
readme.md

@@ -17,7 +17,13 @@ apt-get install git
 git clone https://figureslibres.io/gogs/bachir/debian-web-server.git
 ```
 
-3 run the script as root
+3 change defaut shell from dash to bash
+```
+dpkg-reconfigure dash
+```
+and answer NO to the the question
+
+4 run the script as root
 ```
 su
 cd debian-web-server