From 95fbf3a93c07cb5c93fdf47446c7d6ca99b433eb Mon Sep 17 00:00:00 2001 From: Erreur32 Date: Sun, 19 Apr 2020 18:32:08 +0200 Subject: [PATCH] first commit --- install.sh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index fe24429..29af7a9 100755 --- a/install.sh +++ b/install.sh @@ -40,6 +40,8 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi +pathscript32="$(cd "$(dirname "$0")" && pwd)" + ## clean terminal BG_BLUE="$(tput setab 4)" BG_BLACK="$(tput setab 0)" @@ -71,6 +73,7 @@ echo -e "\033[1;30m # MOTDs32 is dynamicaly refreshing the /etc/motd file with c echo -e "\033[1;30m # about system status and usage." echo -e "\n \e[34m Check MOTDs32 dependencies... \e[0m\n" + # Check dependenciess echo -e "\e[34m Check required dependencies ! (need to be installed)" @@ -196,7 +199,7 @@ tput cup 11 0 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 -n " Git " ; cd ~/MOTDs32 && git pull ; echo -e "\n\e[92m" ; + 2) echo -n " Git " ; cd $pathscript32 && git pull ; echo -e "\n\e[92m" ; grepmot="cat /etc/motd" # if [ `grep -c "cat /etc/motd" ~/.bashrc` == 0 ] if [ $(grep -c "cat /etc/motd" ~/.bashrc) == 0 ] @@ -267,7 +270,15 @@ tput cup 11 0 echo -e "\n\n\e[34m \e[92m Installation of MOTDs32 completed!\e[0m" printf "\n \e[1;33m (Press any key to exit.)\e[0m" ;; - 3) echo -n " Git " ; cd ~/MOTDs32 && git pull ; echo -e "\n\e[92m" ; + 3) echo -n " Git " ; cd $pathscript32 && git pull ; echo -e "\n\e[92m" ; + if [ -f "/etc/motds32/Stats32" ] + then + echo -e " -->\e[34m Stats32 \e[92mOK\e[0m" + cp -f $pathscript32/Stats32 /etc/motds32/Stats32 + else + cp -f $pathscript32/Stats32 /etc/motds32/Stats32 + echo -e " -->\e[32;4m Stats32 \e[92mOK\e[0m" + fi if [ -f "/usr/bin/motds32" ] then echo -e "\n\e[34m - Make file \e[0m>> update.\e[0m\n" @@ -279,14 +290,9 @@ tput cup 11 0 echo -e "\e[32;4m - Make install first !\e[0m\n" echo -e "\n\e[1;33m (Press any key.)\e[0m" fi - if [ -f "/etc/motds32/Stats32" ] - then - echo -e " -->\e[34m Stats32 \e[92mOK\e[0m" - cp -f Stats32 /etc/motds32/Stats32 - else - cp -f Stats32 /etc/motds32/Stats32 - echo -e " -->\e[34m Stats32 \e[92mINSTALLED\e[0m" - fi +# generate new stat +# motd -g + /usr/bin/motds32 -g ;; 4) echo -e "\n\e[34m Unistall of MOTDs32 in progress... \e[0m" ## remove file and directory