summaryrefslogtreecommitdiffstats
path: root/src/usr/local/sbin/ntpdate_sync_once.sh
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-10-01 10:21:43 -0300
committerRenato Botelho <renato@netgate.com>2015-10-01 10:21:43 -0300
commita5c36eb22154a2f17bba4329ee85627eeb64b664 (patch)
treec3bfe52067f1af8586dd85c2118cb66f55d2b227 /src/usr/local/sbin/ntpdate_sync_once.sh
parent339b88930513dec2bc986df7c0cd7255b6815d56 (diff)
downloadpfsense-a5c36eb22154a2f17bba4329ee85627eeb64b664.zip
pfsense-a5c36eb22154a2f17bba4329ee85627eeb64b664.tar.gz
Introduce read_xml_tag.sh
Create /usr/local/sbin/read_xml_tag.sh, that will read a xml tag from config file using xmllint. Replace all direct read using cat, grep, sed, ... by this script
Diffstat (limited to 'src/usr/local/sbin/ntpdate_sync_once.sh')
-rwxr-xr-xsrc/usr/local/sbin/ntpdate_sync_once.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usr/local/sbin/ntpdate_sync_once.sh b/src/usr/local/sbin/ntpdate_sync_once.sh
index c183b79..3372745 100755
--- a/src/usr/local/sbin/ntpdate_sync_once.sh
+++ b/src/usr/local/sbin/ntpdate_sync_once.sh
@@ -2,8 +2,8 @@
NOTSYNCED="true"
MAX_ATTEMPTS=3
-SERVER=`/bin/cat /cf/conf/config.xml | /usr/bin/grep timeservers | /usr/bin/cut -d">" -f2 | /usr/bin/cut -d"<" -f1`
-if [ "${SERVER}" = "" ]; then
+SERVER=$(/usr/local/sbin/read_xml_tag.sh string system/timeservers)
+if [ -z "${SERVER}" ]; then
exit
fi
OpenPOWER on IntegriCloud