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 #