minor changes
This commit is contained in:
parent
32011d93a5
commit
100c60b82b
@ -12,10 +12,11 @@ if [[ $(id -u) -ne 0 ]]; then printf "\nMust be root or use sudo!\n\n"; exit; fi
|
|||||||
# Are we in the right directory
|
# Are we in the right directory
|
||||||
#
|
#
|
||||||
scriptdir="clear-journal-log" && whereami=$(pwd |awk -F'/' '{print $NF}')
|
scriptdir="clear-journal-log" && whereami=$(pwd |awk -F'/' '{print $NF}')
|
||||||
if [ $whereami != $scriptdir ]; then printf "\nWrong directory! Script must be run from $scriptdir\n\n"; exit 1; fi
|
if [ "$whereami" != "$scriptdir" ]; then printf "\nWrong directory! Script must be run from %s\n\n" "$scriptdir"; exit 1; fi
|
||||||
#
|
#
|
||||||
# Define variables and functions
|
# Define variables and functions
|
||||||
#
|
#
|
||||||
|
line () { printf -- '-%.0s' {1..50}; printf '\n'; }
|
||||||
cronjob01="0 2 * * 7 root /usr/local/bin/clear-journal-log >/dev/null 2>&1"
|
cronjob01="0 2 * * 7 root /usr/local/bin/clear-journal-log >/dev/null 2>&1"
|
||||||
#
|
#
|
||||||
# Clear journal log script
|
# Clear journal log script
|
||||||
@ -56,5 +57,9 @@ echo "$cronjob01" > /etc/cron.d/clear-journal-log
|
|||||||
#
|
#
|
||||||
systemctl restart cron.service
|
systemctl restart cron.service
|
||||||
#
|
#
|
||||||
|
# All done display output
|
||||||
|
#
|
||||||
|
clear ; printf "\n" ; line ; printf "All Done...\n" ; line ; printf "\n"
|
||||||
|
#
|
||||||
# End of script
|
# End of script
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user