first commit

This commit is contained in:
Erreur32 2020-04-19 18:32:08 +02:00
parent 2dbc74639c
commit 95fbf3a93c
1 changed files with 16 additions and 10 deletions

View File

@ -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 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 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 in progress... \e[0m"
## remove file and directory