Skip to content

Commit

Permalink
Drop superfluous condition
Browse files Browse the repository at this point in the history
  • Loading branch information
teacup-on-rockingchair committed Nov 8, 2023
1 parent 7286f5f commit 669c80c
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ IFS=" " mapfile -t current_cfg_arr < <(ls -1 /etc/systemd/timesyncd.d/* 2>/dev/n
config_file="/etc/systemd/timesyncd.d/oscap-remedy.conf"
current_cfg_arr+=( "/etc/systemd/timesyncd.conf" )
# Comment existing NTP FallbackNTP settings
if [ ${#current_cfg_arr[@]} -ne 0 ]; then
for current_cfg in "${current_cfg_arr[@]}"
do
sed -i 's/^NTP/#&/g' "$current_cfg"
sed -i 's/^FallbackNTP/#&/g' "$current_cfg"
done
fi
for current_cfg in "${current_cfg_arr[@]}"
do
sed -i 's/^NTP/#&/g' "$current_cfg"
sed -i 's/^FallbackNTP/#&/g' "$current_cfg"
done
# Set primary fallback NTP servers in drop-in configuration
echo "NTP=$preferred_ntp_servers" >> "$config_file"
echo "FallbackNTP=$fallback_ntp_servers" >> "$config_file"
Expand Down

0 comments on commit 669c80c

Please sign in to comment.