source: freewrt/package/quagga/ipkg/quagga.postinst@ 11aebd0

freewrt_1_0 freewrt_2_0
Last change on this file since 11aebd0 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: 1.5 KB
Line 
1#!/bin/sh
2
3name=quagga
4id=51
5dir=/var/run/quagga
6
7# do not change below
8# check if we are on real system
9if [ -z "${IPKG_INSTROOT}" ]; then
10 # create copies of passwd and group, if we use squashfs
11 rootfs=`mount |awk '/root/ { print $5 }'`
12 if [ "$rootfs" = "squashfs" ]; then
13 if [ -h /etc/group ]; then
14 rm /etc/group
15 cp /rom/etc/group /etc/group
16 fi
17 if [ -h /etc/passwd ]; then
18 rm /etc/passwd
19 cp /rom/etc/passwd /etc/passwd
20 fi
21 fi
22fi
23
24echo ""
25if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/group)" ]; then
26 echo "adding group $name to /etc/group"
27 echo "${name}:x:${id}:" >> ${IPKG_INSTROOT}/etc/group
28fi
29
30if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/passwd)" ]; then
31 echo "adding user $name to /etc/passwd"
32 echo "${name}:x:${id}:${id}:${name}:/tmp/.${name}:/bin/false" >> ${IPKG_INSTROOT}/etc/passwd
33fi
34
35grep -q '^zebra[[:space:]]*2601/tcp' ${IPKG_INSTROOT}/etc/services 2>/dev/null
36if [ $? -ne 0 ]; then
37echo "zebrasrv 2600/tcp" >>${IPKG_INSTROOT}/etc/services
38echo "zebra 2601/tcp" >>${IPKG_INSTROOT}/etc/services
39echo "ripd 2602/tcp" >>${IPKG_INSTROOT}/etc/services
40echo "ripngd 2603/tcp" >>${IPKG_INSTROOT}/etc/services
41echo "ospfd 2604/tcp" >>${IPKG_INSTROOT}/etc/services
42echo "bgpd 2605/tcp" >>${IPKG_INSTROOT}/etc/services
43echo "ospf6d 2606/tcp" >>${IPKG_INSTROOT}/etc/services
44echo "ospfapi 2607/tcp" >>${IPKG_INSTROOT}/etc/services
45echo "isisd 2608/tcp" >>${IPKG_INSTROOT}/etc/services
46fi
47
48chown -R $name:$name $dir
Note: See TracBrowser for help on using the repository browser.