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

Take care of busybox config
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Sep 07 14:54:07 2019 +0200 (2019-09-07)
parents 0d8ef9102fc0
children a28c45a86936
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 AUTO_SELECTION="CONFIG_NTPD"
11 DEPENDS="base-tiny"
12 CONFIG_FILES="/etc/daemons.conf /etc/rcS.conf"
14 # Rules to gen a SliTaz package suitable for Tazpkg.
15 genpkg_rules()
16 {
17 mkdir -p $fs/etc
18 }
20 post_install()
21 {
22 grep -q ntpd $1/etc/rcS.conf ||
23 sed -i 's/^RUN_DAEMONS="/&ntpd /' $1/etc/rcS.conf
24 grep -q NTPD_OPTIONS $1/etc/daemons.conf ||
25 cat >> $1/etc/daemons.conf <<EOT
27 # Ntp daemon options.
28 NTPD_OPTIONS="-l -p $NTP_SERVER"
29 EOT
30 }
32 config_form()
33 {
34 [ -n "$NTP_SERVER" ] || NTP_SERVER=fr.pool.ntp.org
35 cat <<EOT
36 <table>
37 <tr>
38 <td>NTP server</td>
39 <td><input type="text" name="NTP_SERVER" value="$NTP_SERVER" /></td>
40 </tr>
41 </table>
42 EOT
43 }