|
|
|
|
@ -19,7 +19,7 @@ main () { |
|
|
|
|
|
|
|
|
|
# check if root |
|
|
|
|
if ! isRoot; then |
|
|
|
|
echo 'Script needs root privileges to alter motd. Re-run with sudo.' |
|
|
|
|
echo 'Script needs root privileges to run. Re-run with sudo.' |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
@ -110,7 +110,11 @@ update() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function printHelp { |
|
|
|
|
printf "./$0 test | update | disable | enable" |
|
|
|
|
echo -e "Use: $0 [ test | update | enable | disable ]\n" |
|
|
|
|
printf " %-6s %s\n" "test" "- Print generated motd to standard output. Use for preview." |
|
|
|
|
printf " %-6s %s\n" "update" "- Update /etc/motd file" |
|
|
|
|
printf " %-6s %s\n" "enable" "- Places $0 in /etc and adds cron entry for script to run every minute" |
|
|
|
|
printf " %-6s %s\n\n" "disable" "- Removes cron entry and disables refreshes of /etc/motd" |
|
|
|
|
exit 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|