Allow $ntpdate_config to be NULL. Due to a lack of surrounding quotes, when
ntpdate_config was set to NULL the conditional would (counter to prevailing logic) succeed -- leading to awk attempting to redirect from a NULL pathname standard-in. While we're here, make the script consistant with itself by removing the {curlies} around ntpdate_config (they are unnecessary).
This commit is contained in:
parent
0203558fe6
commit
cc56559534
@ -16,13 +16,13 @@ start_cmd="ntpdate_start"
|
||||
|
||||
ntpdate_start()
|
||||
{
|
||||
if [ -z "$ntpdate_hosts" -a -f ${ntpdate_config} ]; then
|
||||
if [ -z "$ntpdate_hosts" -a -f "$ntpdate_config" ]; then
|
||||
ntpdate_hosts=`awk '
|
||||
/^server[ \t]*127.127/ {next}
|
||||
/^(server|peer)/ {
|
||||
if ($2 ~/^-/) {print $3}
|
||||
else {print $2}}
|
||||
' < ${ntpdate_config}`
|
||||
' < "$ntpdate_config"`
|
||||
fi
|
||||
if [ -n "$ntpdate_hosts" -o -n "$rc_flags" ]; then
|
||||
echo "Setting date via ntp."
|
||||
|
Loading…
x
Reference in New Issue
Block a user