From 532c2e60e35207ab56961a6401d140b605fd3e0d Mon Sep 17 00:00:00 2001 From: allan Date: Sun, 25 May 2025 11:25:36 +0000 Subject: [PATCH] minor changes --- ntp-client-install | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ntp-client-install b/ntp-client-install index d1dde6c..faa5e23 100755 --- a/ntp-client-install +++ b/ntp-client-install @@ -12,7 +12,11 @@ if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo # Are we in the right directory # scriptdir="ntp-client-install" && 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 +# +line () { printf -- '-%.0s' {1..50}; printf '\n'; } # # Ntp configuration # @@ -32,7 +36,11 @@ printf '%s\n' "${ntpconf[@]}" |sed '$d' > ntpconf sed -i "/Specify one/r ntpconf" /etc/ntpsec/ntp.conf systemctl restart ntp +# +# All done clean up and display output +# rm ntpconf +clear ; printf "\n" ; line ; printf "All Done...\n" ; line ; printf "\n" # # End of script #