Update Install.sh

This commit is contained in:
Erreur32 2017-07-20 19:47:35 +02:00
parent c88f4cf057
commit fa53b1095a
1 changed files with 35 additions and 29 deletions

View File

@ -73,6 +73,7 @@ if [ -f "/etc/motds32/Stats32" ]
else
mkdir /etc/motds32;
cp Stats32 /etc/motds32/Stats32 -Rf
fi
if [ -f /usr/bin/motd ]
@ -83,38 +84,39 @@ if [ -f /usr/bin/motd ]
fi
echo "\Copy files OK\n"
echo -e "\nDo you wish to install the required package?\n --> apt-get install ntp figlet ? (y/n) "
old_stty_cfg=$(stty -g)
stty raw -echo
answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done )
stty $old_stty_cfg
if echo "$answer" | grep -iq "^y" ;then
echo -e "\n1.\e[92m installation \e[0m ntp figlet \e[92m start\e[0m \n" ; apt-get install -y ntp figlet;
echo -e "\n\e[92m apt-get installation \e[0m Succesfull \n"
echo -e "\n start Makefile\n\n"
make install
echo -e "\nMakefile \e[92m OK"
echo -e "\n1.\e[92m installation \e[0m ntp figlet \e[92m start\e[0m" ; #apt-get install -y ntp figlet;
echo -e "\n\e[92m apt-get installation \e[0m Succesfull"
echo -e "\n start Makefile\n"
# make install
echo -e "\n Makefile \e[92m OK"
else
echo -e "\nDo you want to continue this installation? (y/n)\n "
old2_stty_cfg=$(stty -g)
stty raw -echo
answer2=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done )
answer2=$( while ! head -c 2 | grep -i '[ny]' ;do true ;done )
stty $old2_stty_cfg
if echo "$answer2" | grep -iq "^y" ;then
echo -e "\n1.\e[92m ok no apt-get required \e[0m Installation continue... \n"; make install
echo -e "\n1.\e[92m ok no apt-get required \e[0m Installation continue... \n"; #make install
else
exit 1
fi
fi
## Install Crontab
echo -e "check if entry exist in YOUR CRONTAB"
if crontab -l | grep -q '^/usr/bin/motds32$' && echo 'entry exists'
then
echo 'entry already exist'
set -f
if crontab -l | grep -q '^/usr/bin/motds32$' && echo 'entry exists'; then
echo 'Crontab entry already exist'
else
echo 'entry does not exist, it will add'
crontab << FIN fi
echo 'Crontab entry does not exist ...'
crontab << FIN
$(crontab -l)
### MOTDs32 generation (5 min)
@ -122,8 +124,12 @@ $(crontab -l)
###
FIN
echo -e "2.\e[92m crontab -e ROOT\e[0m ADD (generate each 5 minutes)\n"
fi
set +f
## Generate first stats
/usr/bin/motds32 -g