Skip to content

Commit

Permalink
edit time script
Browse files Browse the repository at this point in the history
changing from a nested if..then to an elif.
  • Loading branch information
krispayne authored Nov 29, 2016
1 parent faf0d74 commit 780919b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ElCapitan_CIS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,11 @@ systemPreferences() {
# 2.2.1 Enable "Set time and date automatically"
# Level 2 Not Scored, Level 1.5 Not Scored
if [[ ${CISLEVEL} = "1.5" ]]; then

if [[ "$(/usr/sbin/systemsetup -getusingnetworktime | awk '{ print $3 }')" = "On" ]]; then
ScriptLogging " NetworkTime on. Ensuring server is time.apple.com."

if [[ "$(/usr/sbin/systemsetup -getnetworktimeserver | awk '{ print $4 }')" = "time.apple.com" ]]; then
elif [[ "$(/usr/sbin/systemsetup -getnetworktimeserver | awk '{ print $4 }')" = "time.apple.com" ]]; then
ScriptLogging " NetworkTime is on and set to time.apple.com."
fi
else
if [[ ! -e /etc/ntp.conf ]]; then
ScriptLogging " Create '/etc/ntp.conf'"
Expand Down

0 comments on commit 780919b

Please sign in to comment.