Update install.sh
This commit is contained in:
parent
9efbadee7f
commit
7f3e506ba9
1 changed files with 20 additions and 30 deletions
48
install.sh
48
install.sh
|
@ -39,18 +39,18 @@ clear;
|
||||||
|
|
||||||
cat <<"EOF"
|
cat <<"EOF"
|
||||||
|
|
||||||
Installation of MOTDs32 | + Stats32 |
|
\033[1;32m Installation of MOTDs32 | + Stats32 |
|
||||||
|
|
||||||
,--. ,--. ,-----. ,--------.,------. ,----. ,---.
|
\033[1;37m ,--. ,--. ,-----. ,--------.,------. ,----. ,---.
|
||||||
| `.' |' .-. ''--. .--'| .-. \ ,---. '.-. |'.-. \
|
\033[1;37m | `.' |' .-. ''--. .--'| .-. \ ,---. '.-. |'.-. \
|
||||||
| |'.'| || | | | | | | | \ :( .-' .' ; .-' .'
|
\033[1;37m | |'.'| || | | | | | | | \ :( .-' .' ; .-' .'
|
||||||
| | | |' '-' ' | | | '--' /.-' `)/'-' |/ '-.
|
\033[1;37m | | | |' '-' ' | | | '--' /.-' `)/'-' |/ '-.
|
||||||
`--' `--' `-----' `--' `-------' `----' `----' '-----'
|
\033[1;37m `--' `--' `-----' `--' `-------' `----' `----' '-----'
|
||||||
|
|
||||||
By Erreur32
|
By Erreur32
|
||||||
|
|
||||||
# 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 MOTDs32 in progress... \e[0m"
|
echo -e "\n\e[34mInstallation of MOTDs32 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 Installation of MOTDs32 completed!\e[0m \n\n\nUse: /usr/bin/motds32 for help\n"
|
echo -e "\n\e[34m \e[92m Installation of MOTDs32 completed!\e[0m \n\n\nUse: /usr/bin/motds32 for help\n"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue