/usr/sbin/ntpdate is in ntpsec-ntpdate 1.1.0+dfsg1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | #!/bin/sh
#
# ntpdate - emulate the crufty old ntpdate utility from NTP Classic
#
# Not documented, as this is strictly a backward-compatibility shim. It's
# based on the recipes at
# http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate
# with corrections for modern ntpdig options.
#
# Debug this by giving the -n option, which causes it to echo the
# generated ntpdig command rather than executing it.
#
# Known bugs:
# * The -e and -p options of ntpdate are not yet implemented.
# * ntpdate took 4 samples and chose the best (shortest trip time).
# This takes the first.
#
# ntpdate ntpdig ntpd What it does
# -4 -4 -q -4 Resolve DNS lookups to A records
# -6 -6 -q -6 Resolve DNS lookups to AAAA records
# -a N -a N -q Authentication
# -b -S -q step time adjustments
# -B -s -q slew time adjustments
# -d -d -d debugging mode (implies -q)
# -e N.N -q authdelay
# -k file -k file -k file key file
# -o N -o N -q NTP Protocol version
# -p N -q How many samples to take
# -q default -q query/report only, don't set clock
# (implies -u for ntpdate)
# -s -p log to syslog (always enabled in ntpd)
# -t N.N -t N.N request timeout
# -u default unpriv port
# -v verbose (ntpd is always more verbose than ntpdate)
# -c name Send concurrent requests to resolved IPs for name
#
# -l file Log to file
# -M msec Slew adjustments less than msec,
# step adjustments larger than msec.
#
# SPDX-License-Identifier: BSD-2-Clause
PASSTHROUGH=""
TIMEOUT="-t 1"
setclock=yes
echo=""
while getopts 46a:bBe:k:no:p:qst:uv opt
do
case $opt in
4) PASSTHROUGH="$PASSTHROUGH -4";;
6) PASSTHROUGH="$PASSTHROUGH -6";;
a) PASSTHROUGH="$PASSTHROUGH -a $OPTARG";;
b) ADJUST="$ADJUST -S";;
B) ADJUST="$ADJUST -s";;
d) PASSTHROUGH="$PASSTHROUGH -d";;
e) echo "ntpdate: -e is no longer supported." >&2;;
k) PASSTHROUGH="$PASSTHROUGH -k $OPTARG";;
n) echo=echo ;; # Echo generated command, don't execute
o) PASSTHROUGH="$PASSTHROUGH -o $OPTARG";;
p) echo "ntpdate: -p is no longer supported." >&2;;
q) setclock=no;;
s) PASSTHROUGH="$PASSTHROUGH -p";;
t) PASSTHROUGH="$PASSTHROUGH -t $OPTARG"; TIMEOUT="";;
u) ;;
v) ;;
esac
done
shift $(($OPTIND - 1))
if [ "$setclock" = yes -a -z "$ADJUST" ]
then
ADJUST="-s -j"
fi
$echo ntpdig $ADJUST $TIMEOUT $PASSTHROUGH $*
#end
|