wok-tiny view ntp-config/receipt @ rev 109

Update custom-console
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 27 10:51:46 2016 +0100 (2016-02-27)
parents 371673f39e46
children e37956962a84
line source
1 # SliTaz package receipt.
3 PACKAGE="ntp-config"
4 VERSION="1.0"
5 CATEGORY="network"
6 SHORT_DESC="Network time protocol configuration"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="http://tiny.slitaz.org/"
10 DEPENDS="base-tiny"
11 CONFIG_FILES="/etc/daemons.conf /etc/rcS.conf"
13 # Rules to gen a SliTaz package suitable for Tazpkg.
14 genpkg_rules()
15 {
16 mkdir -p $fs/etc
17 }
19 post_install()
20 {
21 grep -q ntpd $1/etc/rcS.conf ||
22 sed -i 's/^RUN_DAEMONS="/&ntpd /' $1/etc/rcS.conf
23 grep -q NTPD_OPTIONS $1/etc/daemons.conf ||
24 cat >> $1/etc/daemons.conf <<EOT
26 # Ntp daemon options.
27 NTPD_OPTIONS="-l -p $NTP_SERVER"
28 EOT
29 }
31 config_form()
32 {
33 [ -n "$NTP_SERVER" ] || NTP_SERVER=fr.pool.ntp.org
34 cat <<EOT
35 <table>
36 <tr>
37 <td>NTP server</td>
38 <td><input type="text" name="NTP_SERVER" value="$NTP_SERVER" /></td>
39 </tr>
40 </table>
41 EOT
42 }