Update install.sh
This commit is contained in:
parent
2465cbb587
commit
c62a662828
53
install.sh
53
install.sh
|
@ -89,6 +89,7 @@ echo -e "\n YOU CAN SKIP auto install if you want"
|
||||||
echo -e "\n\e[92m Please Select:"
|
echo -e "\n\e[92m Please Select:"
|
||||||
echo -e " 1. \e[0m(auto)Install Missing Package\e[92m"
|
echo -e " 1. \e[0m(auto)Install Missing Package\e[92m"
|
||||||
echo -e " 2. \e[0mContinue installation script\e[92m"
|
echo -e " 2. \e[0mContinue installation script\e[92m"
|
||||||
|
echo -e " 3. \e[0mUninstall completly the script\e[92m"
|
||||||
echo -e " 0. \e[0mQuit\n \e[0m"
|
echo -e " 0. \e[0mQuit\n \e[0m"
|
||||||
read -p " Enter selection [0-2] > " selection
|
read -p " Enter selection [0-2] > " selection
|
||||||
|
|
||||||
|
@ -230,39 +231,33 @@ exit 1
|
||||||
# Restore screen
|
# Restore screen
|
||||||
tput rmcup
|
tput rmcup
|
||||||
;;
|
;;
|
||||||
3)
|
3) echo -e "\n\e[34m Dsinstallation of MOTDs32 in progress... \e[0m"
|
||||||
echo -e "\n\e[34m Dsinstallation of MOTDs32 in progress... \e[0m"
|
|
||||||
|
|
||||||
|
|
||||||
## remove file and directory
|
## remove file and directory
|
||||||
make uninstall
|
make uninstall
|
||||||
rm /etc/motds32/ -Rf
|
rm /etc/motds32/ -Rf
|
||||||
rm /usr/bin/motd -f
|
rm /usr/bin/motd -f
|
||||||
rm /var/cache/motds32/ -Rf
|
rm /var/cache/motds32/ -Rf
|
||||||
|
|
||||||
## remove cron
|
## remove cron
|
||||||
if crontab -l | grep -q '/usr/bin/motds32'; then
|
if crontab -l | grep -q '/usr/bin/motds32'; then
|
||||||
echo -e "2.\e[92m Cron localized\n"
|
echo -e "2.\e[92m Cron localized\n"
|
||||||
crontab -l | grep -v '/usr/bin/motds32 -g 2>1' | crontab -u root -
|
crontab -l | grep -v '/usr/bin/motds32 -g 2>1' | crontab -u root -
|
||||||
echo -e "2.\e[92m Cron removed\n"
|
echo -e "2.\e[92m Cron removed\n"
|
||||||
else
|
else
|
||||||
echo -e "2.\e[93m Cron not find\n"
|
echo -e "2.\e[93m Cron not find\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ `grep -c /etc/motd /root/.bashrc` == 0 ]
|
||||||
if [ `grep -c /etc/motd /root/.bashrc` == 0 ]
|
then
|
||||||
then
|
echo "Code bash not founded"
|
||||||
echo "Code bash not founded"
|
else
|
||||||
#echo "cat /etc/motd" >> /root/.bashrc
|
echo "code bash founded"
|
||||||
#echo -e "\e[92m Code .bashrc added.\e[0m"
|
sed -i '/cat \/etc\/motd/d' /root/.bashrc
|
||||||
else
|
echo -e "\e[92m Code .bashrc remove.\e[0m"
|
||||||
echo "code bash founded"
|
grep -n '/etc/motd' /root/.bashrc
|
||||||
sed -i '/cat \/etc\/motd/d' /root/.bashrc
|
fi
|
||||||
echo -e "\e[92m Code .bashrc remove.\e[0m"
|
|
||||||
grep -n '/etc/motd' /root/.bashrc
|
echo -e "\n\e[92m Script MOTDs32 has been completly removed \e[0m"
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\n\e[92m Script MOTDs32 has been completly removed \e[0m
|
|
||||||
;;
|
;;
|
||||||
0) break
|
0) break
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue