Added uninstall.sh
This commit is contained in:
18
uninstall.sh
Normal file
18
uninstall.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# install.sh / uninstall.sh — Custom MOTD installer
|
||||
# Symlink or rename this file; behaviour switches on the script name.
|
||||
set -euo pipefail
|
||||
|
||||
TARGET="/etc/profile.d/motd.sh"
|
||||
MOTD_D="/etc/update-motd.d"
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "Error: run as root (sudo $0)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Removing $TARGET..."
|
||||
rm -f "$TARGET"
|
||||
echo "Re-enabling default MOTD scripts..."
|
||||
chmod +x "$MOTD_D"/*
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user