#!/bin/bash NTPDATE_FILE="/etc/default/ntpdate" sed_script(){ echo "/^[[:blank:]]*NTPSERVERS=/s%\bNTPSERVERS=.*$%NTPSERVERS=\"${NTP_SERVERS}\"%;" echo "/^[[:blank:]]*NTPDATE_USE_NTP_CONF=/s%NTPDATE_USE_NTP_CONF=.*$%NTPDATE_USE_NTP_CONF=no%" } # ---- # main # ---- # load vars VAR_LIST="NTP_SERVERS" [ -x "/usr/sbin/llxcfg-showvars" ] && eval `/usr/sbin/llxcfg-showvars ${VAR_LIST}` if [ "$NTP_SERVERS" ] && which ntpdate-debian &>/dev/null ; then llxcfg-cpkg plainview $NTPDATE_FILE |sed -e "$(sed_script)" |skel-install "$NTPDATE_FILE" fi exit 0