mirror of
https://github.com/munin-monitoring/muninlite.git
synced 2024-12-22 13:52:13 +01:00
Arrays is a bashismn
git-svn-id: svn://svn.code.sf.net/p/muninlite/code/muninlite@31 35caa317-6b62-4e8a-81c0-b04f0c356266
This commit is contained in:
parent
7e464ae867
commit
0e1e1b6bbc
1 changed files with 9 additions and 6 deletions
|
@ -9,13 +9,16 @@ config_ntpdate() {
|
|||
|
||||
fetch_ntpdate() {
|
||||
NTPDATE="/usr/sbin/ntpdate"
|
||||
DATA=(0 0)
|
||||
OFFSET=0
|
||||
DELAY=0
|
||||
if [ "$NTP_PEER" != "" ]; then
|
||||
if [ -x "$NTPDATE" ]; then
|
||||
DATA=($($NTPDATE -q $NTP_PEER | awk '/^server.*offset/{gsub(/,/,"");printf "%s %s", ($6*1000), ($8*1000);}'))
|
||||
DATA=$($NTPDATE -q $NTP_PEER | awk '/^server.*offset/{gsub(/,/,"");printf "%s %s", ($6*1000), ($8*1000);}')
|
||||
OFFSET=$(echo "$DATA" | cut -d\ -f1)
|
||||
DELAY=$(echo "$DATA" | cut -d\ -f2)
|
||||
fi
|
||||
fi
|
||||
echo "offset.value "${DATA[0]}
|
||||
echo "delay.value "${DATA[1]}
|
||||
echo "offset.value $OFFSET"
|
||||
echo "delay.value $DELAY"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue