2017-07-20 11:01:51 +02:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
2017-07-20 16:02:34 +02:00
|
|
|
|
# Removal script of MOTDs32
|
2017-07-20 11:01:51 +02:00
|
|
|
|
#
|
2017-07-20 16:02:34 +02:00
|
|
|
|
# make sur this file is executable +x
|
2017-07-20 11:01:51 +02:00
|
|
|
|
|
|
|
|
|
|
2017-07-20 20:53:52 +02:00
|
|
|
|
## clean terminal
|
|
|
|
|
clear;
|
|
|
|
|
|
|
|
|
|
cat <<"EOF"
|
|
|
|
|
|
2017-07-20 20:54:11 +02:00
|
|
|
|
Desinstallation of MOTDs32 | + Stats32 |
|
2017-07-20 20:53:52 +02:00
|
|
|
|
|
|
|
|
|
,--. ,--. ,-----. ,--------.,------. ,----. ,---.
|
|
|
|
|
| `.' |' .-. ''--. .--'| .-. \ ,---. '.-. |'.-. \
|
|
|
|
|
| |'.'| || | | | | | | | \ :( .-' .' ; .-' .'
|
|
|
|
|
| | | |' '-' ' | | | '--' /.-' `)/'-' |/ '-.
|
|
|
|
|
`--' `--' `-----' `--' `-------' `----' `----' '-----'
|
|
|
|
|
|
|
|
|
|
By Erreur32
|
|
|
|
|
|
|
|
|
|
# MOTDstat is dynamicaly refreshing the /etc/motd file with current informations
|
|
|
|
|
# about system status and usage.
|
|
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
# Make sure only root can run our script
|
|
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
|
|
|
echo "This script must be run as root" 1>&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo -e "\n\e[34m Dsinstallation of MOTDs32 in progress... \e[0m"
|
|
|
|
|
|
|
|
|
|
|
2017-07-20 21:29:39 +02:00
|
|
|
|
## remove file and directory
|
2017-07-20 14:47:26 +02:00
|
|
|
|
make uninstall
|
|
|
|
|
rm /etc/motds32/ -Rf
|
2017-07-20 20:52:07 +02:00
|
|
|
|
rm /usr/bin/motd -f
|
|
|
|
|
|
2017-07-20 21:29:39 +02:00
|
|
|
|
## 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
|
|
|
|
|
|
|
|
|
|
echo -e "\n\e[92m Script MOTDs32 has been removed \e[0m"
|