diff --git a/install.sh b/install.sh index 52c7872..f7ac42c 100755 --- a/install.sh +++ b/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 " 1. \e[0m(auto)Install Missing Package\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" read -p " Enter selection [0-2] > " selection @@ -230,39 +231,33 @@ exit 1 # Restore screen tput rmcup ;; - 3) -echo -e "\n\e[34m Dsinstallation of MOTDs32 in progress... \e[0m" - - + 3) echo -e "\n\e[34m Dsinstallation of MOTDs32 in progress... \e[0m" ## remove file and directory -make uninstall -rm /etc/motds32/ -Rf -rm /usr/bin/motd -f -rm /var/cache/motds32/ -Rf + make uninstall + rm /etc/motds32/ -Rf + rm /usr/bin/motd -f + rm /var/cache/motds32/ -Rf ## remove cron -if crontab -l | grep -q '/usr/bin/motds32'; then -echo -e "2.\e[92m Cron localized\n" -crontab -l | grep -v '/usr/bin/motds32 -g 2>1' | crontab -u root - -echo -e "2.\e[92m Cron removed\n" -else -echo -e "2.\e[93m Cron not find\n" -fi + if crontab -l | grep -q '/usr/bin/motds32'; then + echo -e "2.\e[92m Cron localized\n" + crontab -l | grep -v '/usr/bin/motds32 -g 2>1' | crontab -u root - + echo -e "2.\e[92m Cron removed\n" + else + echo -e "2.\e[93m Cron not find\n" + fi - -if [ `grep -c /etc/motd /root/.bashrc` == 0 ] -then -echo "Code bash not founded" -#echo "cat /etc/motd" >> /root/.bashrc -#echo -e "\e[92m Code .bashrc added.\e[0m" -else - echo "code bash founded" -sed -i '/cat \/etc\/motd/d' /root/.bashrc -echo -e "\e[92m Code .bashrc remove.\e[0m" -grep -n '/etc/motd' /root/.bashrc -fi - -echo -e "\n\e[92m Script MOTDs32 has been completly removed \e[0m + if [ `grep -c /etc/motd /root/.bashrc` == 0 ] + then + echo "Code bash not founded" + else + echo "code bash founded" + sed -i '/cat \/etc\/motd/d' /root/.bashrc + echo -e "\e[92m Code .bashrc remove.\e[0m" + grep -n '/etc/motd' /root/.bashrc + fi + + echo -e "\n\e[92m Script MOTDs32 has been completly removed \e[0m" ;; 0) break ;;