48 lines
985 B
Text
48 lines
985 B
Text
|
#!/bin/sh
|
||
|
# Nico Schottelius
|
||
|
# cinit: install ntpdate
|
||
|
# Date: 2005-10-15
|
||
|
#
|
||
|
|
||
|
. $(dirname $0)/cinit-conf.read-conf
|
||
|
|
||
|
set -e
|
||
|
|
||
|
if [ $# -ne 0 ]; then
|
||
|
echo "$(basename $0) (no args)"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
. /etc/default/ntpdate
|
||
|
|
||
|
if [ -z "$NTPSERVERS" ]; then
|
||
|
echo "No ntp servers found, aborting"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
BINARY_PATH=$($(dirname $0)/cinit.path-find ntpdate)
|
||
|
|
||
|
if [ $? -ne 0 ]; then
|
||
|
echo "Did not find binary ntpdate."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [ -d "${DESTDIR}/${CINIT_DIR}/local-tuning/ntpdate" ]; then
|
||
|
echo "Service ntpdate already exists."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
echo -n "Installing ntpdate to ${DESTDIR}/${CINIT_DIR}/local-tuning/ntpdate ..."
|
||
|
|
||
|
"$INSTALL_PROG" "$INSTALL_DIRECTORY" \
|
||
|
"${DESTDIR}/${CINIT_DIR}/local-tuning/ntpdate"
|
||
|
ln -sf "$BINARY_PATH" "${DESTDIR}/${CINIT_DIR}/local-tuning/ntpdate/$C_ON"
|
||
|
|
||
|
for server in $NTPSERVERS; do
|
||
|
echo "$server" >> "${DESTDIR}/${CINIT_DIR}/local-tuning/ntpdate/$C_ON$C_PARAMS"
|
||
|
done
|
||
|
|
||
|
echo "finished."
|
||
|
|
||
|
exit 0
|