wok-tiny rev 5

Add ntp-config
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 01 23:10:34 2011 +0100 (2011-02-01)
parents 956ee7ef6dfe
children d3e7e88d97ef
files ntp-config/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ntp-config/receipt	Tue Feb 01 23:10:34 2011 +0100
     1.3 @@ -0,0 +1,41 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="ntp-config"
     1.7 +VERSION="1.0"
     1.8 +CATEGORY="tiny-slitaz"
     1.9 +SHORT_DESC="Network time protocol configuration"
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +WEB_SITE="http://mirror.slitaz.org/pizza/tiny/"
    1.12 +DEPENDS="base-tiny"
    1.13 +CONFIG_FILES="/etc/daemons.conf /etc/rcS.conf"
    1.14 +
    1.15 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.16 +genpkg_rules()
    1.17 +{
    1.18 +	mkdir -p $fs/etc
    1.19 +}
    1.20 +
    1.21 +post_install()
    1.22 +{
    1.23 +	grep -q ntpd $1/etc/rcS.conf ||
    1.24 +	sed -i 's/^RUN_DAEMONS="/&ntpd /' $1/etc/rcS.conf
    1.25 +	grep -q NTPD_OPTIONS $1/etc/daemons.conf ||
    1.26 +	cat >> $1/etc/daemons.conf <<EOT
    1.27 +
    1.28 +# Ntp daemon options.
    1.29 +NTPD_OPTIONS="-l -p $NTP_SERVER"
    1.30 +EOT
    1.31 +}
    1.32 +
    1.33 +config_form()
    1.34 +{
    1.35 +	[ -n "$NTP_SERVER" ] || NTP_SERVER=fr.pool.ntp.org
    1.36 +	cat <<EOT
    1.37 +<table>
    1.38 +<tr>
    1.39 +<td>NTP server</td>
    1.40 +<td><input type="text" name="NTP_SERVER" value="$NTP_SERVER" /></td>
    1.41 +</tr>
    1.42 +</table>
    1.43 +EOT
    1.44 +}