source: freewrt/package/openntpd/ipkg/openntpd.postinst@ 428f140

freewrt_1_0 freewrt_2_0
Last change on this file since 428f140 was 475ad56, checked in by Waldemar Brodkorb <wbx@…>, 20 years ago

add OpenWrt trunk revision 3830.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@1 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 963 bytes
Line 
1#!/bin/sh
2
3name=ntp
4id=50
5
6# do not change below
7# check if we are on real system
8if [ -z "${IPKG_INSTROOT}" ]; then
9 # create copies of passwd and group, if we use squashfs
10 rootfs=`mount |awk '/root/ { print $5 }'`
11 if [ "$rootfs" = "squashfs" ]; then
12 if [ -h /etc/group ]; then
13 rm /etc/group
14 cp -p /rom/etc/group /etc/group
15 fi
16 if [ -h /etc/passwd ]; then
17 rm /etc/passwd
18 cp -p /rom/etc/passwd /etc/passwd
19 fi
20 fi
21fi
22
23echo ""
24if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/group)" ]; then
25 echo "adding group $name to /etc/group"
26 echo "${name}:x:${id}:" >> ${IPKG_INSTROOT}/etc/group
27fi
28
29if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/passwd)" ]; then
30 echo "adding user $name to /etc/passwd"
31 echo "${name}:x:${id}:${id}:${name}:/tmp/.${name}:/bin/false" >> ${IPKG_INSTROOT}/etc/passwd
32fi
33
34grep -q '^ntp[[:space:]]*123/udp' ${IPKG_INSTROOT}/etc/services 2>/dev/null
35[ $? -ne 0 ] && echo "ntp 123/udp" >>${IPKG_INSTROOT}/etc/services
Note: See TracBrowser for help on using the repository browser.