import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
parent
3729fc68eb
commit
423ba10303
13396 changed files with 269468 additions and 0 deletions
|
|
@ -0,0 +1,47 @@
|
|||
#!/bin/sh
|
||||
# Nico Schottelius
|
||||
# cinit: install ntpdate
|
||||
# Date: 2005-10-15
|
||||
#
|
||||
|
||||
. $(dirname $0)/cinit.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
|
||||
Loading…
Add table
Add a link
Reference in a new issue