Révision b132ffc0
fixed issue when more than one server is asked (e.g. pool.ntp.org)
| plugins/other/ntpdate_ | ||
|---|---|---|
| 38 | 38 |
exit 0 |
| 39 | 39 |
fi |
| 40 | 40 |
|
| 41 |
DATA=($($NTPDATE -q $PEER | awk '/^server.*offset/{gsub(/,/,"");printf "%s %s", ($6*1000), ($8*1000);}'))
|
|
| 41 |
DATA=($($NTPDATE -q $PEER | awk '/^server.*offset/{gsub(/,/,"");if(dela==0||$8<dela){offs=$6;dela=$8;}}END{print offs*1000,dela*1000;}'))
|
|
| 42 | 42 |
|
| 43 | 43 |
echo "offset.value "${DATA[0]}
|
| 44 | 44 |
echo "delay.value "${DATA[1]}
|
Formats disponibles : Unified diff