From faaaa9b7f964909afa99c928e04b4af9487b9804 Mon Sep 17 00:00:00 2001 From: Erreur32 Date: Thu, 16 Apr 2020 14:46:22 +0200 Subject: [PATCH] first commit --- install.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index 2573e38..1d0cd39 100755 --- a/install.sh +++ b/install.sh @@ -110,7 +110,7 @@ echo -e " \e[34m- build-essential \e[1;31mSelect option 1 \e[91m Missing pa echo -e "\n YOU CAN SKIP (auto) install if you want" echo -e "\n\e[92m Please Select:" echo -e " 1. \e[0m(auto) Install Missing Package\e[92m" -echo -e " 2. \e[0mInstallation/(CHECK) MOTDs32 script\e[92m" +echo -e " 2. \e[0mInstallation/Update MOTDs32 script\e[92m" echo -e " 3. \e[0mUninstall completly MOTDs32 script\e[92m" echo -e " 0. \e[0m(Enter or any key) to Quit\n \e[0m" read -p " Enter selection [0-3] or (Enter) to Quit > " selection @@ -141,7 +141,7 @@ tput cup 11 0 echo -e "\e[92m" if [ `grep -c /etc/motd ~/.bashrc` == 0 ] then - echo -e " \e[1;31m code bash missing" + echo -e " \e[31m code bash missing\e[0m" echo "cat /etc/motd" >> ~/.bashrc echo -e "\e[92m - Code bash \e[0madded.\n" else @@ -156,7 +156,7 @@ tput cup 11 0 if [ -f "/etc/motds32/Stats32" ] then echo -e " -->\e[34m Stats32 \e[92mOK\e[0m" - cp Stats32 /etc/motds32/Stats32 + cp -f Stats32 /etc/motds32/Stats32 else cp -f Stats32 /etc/motds32/Stats32 echo -e " -->\e[34m Stats32 \e[92mINSTALLED\e[0m" @@ -193,14 +193,14 @@ if test -f /usr/bin/motds32; then /usr/bin/motds32 -g; fi printf "\n \e[1;33m (Press 0 to exit)\e[0m" printf "\n \e[1;33m (Or any key to go back.)\e[0m" ;; - 2) echo -e "\n\e[92m" + 2) echo -e "\n\e[92m" ; if [ `grep -c /etc/motd ~/.bashrc` == 0 ] then echo -e " code bash missing" echo "cat /etc/motd" >> ~/.bashrc echo -e "\e[92m - Code bash \e[0madded.\n" else - grepmot=`grep '/etc/motd' ~/.bashrc` + grepmot=$(grep "etc/motd" ~/.bashrc) echo -e " \e[1;30m Code bash found: \e[0m>>\e[0m $grepmot \e[0m<<\n" echo -e " -->\e[34m Code bash: \e[92mOK\e[0m" fi @@ -218,13 +218,13 @@ if test -f /usr/bin/motds32; then /usr/bin/motds32 -g; fi make install echo -e "\n\e[34m - Make file done.\e[0m\n" fi - + if [ -f "/etc/motds32/Stats32" ] then echo -e " -->\e[34m Stats32 \e[92mOK\e[0m" - cp Stats32 /etc/motds32/Stats32 -Rf + cp Stats32 /etc/motds32/Stats32 -f else - cp Stats32 /etc/motds32/Stats32 -Rf + cp Stats32 /etc/motds32/Stats32 -f echo -e " -->\e[34m Stats32 \e[92mINSTALLED\e[0m" fi @@ -249,12 +249,13 @@ if test -f /usr/bin/motds32; then /usr/bin/motds32 -g; fi ## Install Crontab if crontab -l | grep -q '/usr/bin/motds32'; then echo -e "\e[34m - Cron \e[0m>> already added.\e[0m" + /usr/bin/motds32 -g else echo -e "\e[34m - Cron added.\e[0m" (crontab -l ; echo "*/5 * * * * /usr/bin/motds32 -g 2>1")| crontab - fi ## Generate first stats - if test -f /usr/bin/motds32; then /usr/bin/motds32 -g; fi +# if test -f /usr/bin/motds32; then /usr/bin/motds32 -g; fi echo -e "\n\n\e[34m \e[92m Installation of MOTDs32 completed!\e[0m \n\n\n Help? Use: \n \033[1;30m /usr/bin/motds32\e[0m \n or \033[1;30m\n motd\e[0m\n" printf "\n \e[1;33m (Press any key to exit.)\e[0m"