Update install.sh

This commit is contained in:
Erreur32 2017-07-21 09:25:02 +02:00
parent 9efbadee7f
commit 7f3e506ba9

View file

@ -39,18 +39,18 @@ clear;
cat <<"EOF" cat <<"EOF"
| + | \033[1;32m | + |
,--. ,--. ,-----. ,--------.,------. ,----. ,---. \033[1;37m ,--. ,--. ,-----. ,--------.,------. ,----. ,---.
| `.' |' .-. ''--. .--'| .-. \ ,---. '.-. |'.-. \ \033[1;37m | `.' |' .-. ''--. .--'| .-. \ ,---. '.-. |'.-. \
| |'.'| || | | | | | | | \ :( .-' .' ; .-' .' \033[1;37m | |'.'| || | | | | | | | \ :( .-' .' ; .-' .'
| | | |' '-' ' | | | '--' /.-' `)/'-' |/ '-. \033[1;37m | | | |' '-' ' | | | '--' /.-' `)/'-' |/ '-.
`--' `--' `-----' `--' `-------' `----' `----' '-----' \033[1;37m `--' `--' `-----' `--' `-------' `----' `----' '-----'
By By
# MOTDstat is dynamicaly refreshing the /etc/motd file with current informations \033[1;30m# MOTDstat is dynamicaly refreshing the /etc/motd file with current informations
# about system status and usage. \033[1;30m# about system status and usage.
EOF EOF
@ -60,13 +60,13 @@ if [[ $EUID -ne 0 ]]; then
exit 1 exit 1
fi fi
echo -e "\n\e[34mInstallation of in progress... \e[0m" echo -e "\n\e[34mInstallation of in progress... \e[0m\n\n"
## Install command in bashrc ## Install command in bashrc
echo -ne '\e[0m # (5%)\r' #echo -ne '\e[0m # (5%)\r'
sleep 1 #sleep 1
echo -e "\n\n" #echo -e "\n\n"
if [ `grep -c /etc/motd /root/.bashrc` == 0 ] if [ `grep -c /etc/motd /root/.bashrc` == 0 ]
then then
@ -101,9 +101,9 @@ if [ -f /usr/bin/motd ]
fi fi
echo -e " -->\e[34m Copy files OK\n" echo -e " -->\e[34m Copy files OK\n"
echo -ne '\e[0m #########(50%)\r' #echo -ne '\e[0m #########(50%)\r'
sleep 1 #sleep 1
echo -ne "\n" #echo -ne "\n"
echo -e "\nDo you wish to install the required package?\n \e[0m --> apt-get install ntp figlet ? (y/n) " echo -e "\nDo you wish to install the required package?\n \e[0m --> apt-get install ntp figlet ? (y/n) "
old_stty_cfg=$(stty -g) old_stty_cfg=$(stty -g)
stty raw -echo stty raw -echo
@ -132,9 +132,9 @@ stty $old2_stty_cfg
fi fi
fi fi
echo -ne '\e[0m ##################(90%)\r' #echo -ne '\e[0m ##################(90%)\r'
sleep 1 #sleep 1
echo -e "\n" #echo -e "\n"
## Install Crontab ## Install Crontab
if crontab -l | grep -q '/usr/bin/motds32'; then if crontab -l | grep -q '/usr/bin/motds32'; then
@ -144,22 +144,12 @@ echo -e "\e[92m Cron added."
(crontab -l ; echo "*/5 * * * * /usr/bin/motds32 -g 2>1")| crontab - (crontab -l ; echo "*/5 * * * * /usr/bin/motds32 -g 2>1")| crontab -
fi fi
#crontab -l | grep -q '/usr/bin/motds32' && echo 'entry exists' || echo -e "2.\e[92m Cron add ==> \e[0m */5 * * * * /usr/bin/motds32 -g 2>1 \e[92m (generate each 5 minutes)\n" && */5 * * * * root /usr/bin/motds32 -g 2>1
#crontab << FIN
#$(crontab -l)
#
#*/5 * * * * /usr/bin/motds32 -g 2>1
#FIN
## todo
### MOTDs32 generation (5 min)
#/5 * * * * /usr/bin/motds32 -g 2>1
###
## Generate first stats ## Generate first stats
/usr/bin/motds32 -g /usr/bin/motds32 -g
echo -ne '\n\e[0m #######################(100%)\r\n\n' #echo -ne '\n\e[0m #######################(100%)\r\n\n'
echo -e "\n\e[34m \e[92m completed!\e[0m \n\n\nUse: /usr/bin/motds32 for help\n" echo -e "\n\e[34m \e[92m completed!\e[0m \n\n\nUse: /usr/bin/motds32 for help\n"
exit 0 exit 0