MOTDs32/unisntall.sh
2017-07-20 21:29:39 +02:00

51 lines
1.3 KiB
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
#
# Removal script of MOTDs32
#
# make sur this file is executable +x
## clean terminal
clear;
cat <<"EOF"
Desi | + |
,--. ,--. ,-----. ,--------.,------. ,----. ,---.
| `.' |' .-. ''--. .--'| .-. \ ,---. '.-. |'.-. \
| |'.'| || | | | | | | | \ :( .-' .' ; .-' .'
| | | |' '-' ' | | | '--' /.-' `)/'-' |/ '-.
`--' `--' `-----' `--' `-------' `----' `----' '-----'
By
# 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 in progress... \e[0m"
## remove file and directory
make uninstall
rm /etc/motds32/ -Rf
rm /usr/bin/motd -f
## 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 has been removed \e[0m"