minor changes
This commit is contained in:
parent
8cfeb68e4a
commit
532c2e60e3
@ -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
|
# Are we in the right directory
|
||||||
#
|
#
|
||||||
scriptdir="ntp-client-install" && whereami=$(pwd |awk -F'/' '{print $NF}')
|
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
|
# Ntp configuration
|
||||||
#
|
#
|
||||||
@ -32,7 +36,11 @@ printf '%s\n' "${ntpconf[@]}" |sed '$d' > ntpconf
|
|||||||
sed -i "/Specify one/r ntpconf" /etc/ntpsec/ntp.conf
|
sed -i "/Specify one/r ntpconf" /etc/ntpsec/ntp.conf
|
||||||
|
|
||||||
systemctl restart ntp
|
systemctl restart ntp
|
||||||
|
#
|
||||||
|
# All done clean up and display output
|
||||||
|
#
|
||||||
rm ntpconf
|
rm ntpconf
|
||||||
|
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