Skip to content

Commit

Permalink
Improve code style working with bash arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
teacup-on-rockingchair committed Jul 5, 2023
1 parent 60a8692 commit de112bd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
{{{ bash_instantiate_variables("var_multiple_time_servers") }}}

IFS=',' read -r -a time_servers_array <<< "$var_multiple_time_servers"
preferred_ntp_servers_array="${time_servers_array[@]:0:2}"
preferred_ntp_servers=$( echo ${preferred_ntp_servers_array[@]}|sed -e 's/\s\+/,/g' )
fallback_ntp_servers_array="${time_servers_array[@]:2}"
fallback_ntp_servers=$( echo ${fallback_ntp_servers_array[@]}|sed -e 's/\s\+/,/g' )
preferred_ntp_servers_array=("${time_servers_array[@]:0:2}")
preferred_ntp_servers=$( echo "${preferred_ntp_servers_array[@]}"|sed -e 's/\s\+/,/g' )
fallback_ntp_servers_array=("${time_servers_array[@]:2}")
fallback_ntp_servers=$( echo "${fallback_ntp_servers_array[@]}"|sed -e 's/\s\+/,/g' )

config_file="/etc/systemd/timesyncd.d/oscap-remedy.conf"
current_cfg_arr=( "/etc/systemd/timesyncd.conf" )
Expand Down

0 comments on commit de112bd

Please sign in to comment.