]> git.proxmox.com Git - mirror_frr.git/blob - debianpkg/backports/ubuntu12.04/debian/frr.postinst
debianpkg/Ubuntu12.04-backport: Remove accidental reference to frr_sudoers
[mirror_frr.git] / debianpkg / backports / ubuntu12.04 / debian / frr.postinst
1 #!/bin/bash -e
2
3 ######################
4 PASSWDFILE=/etc/passwd
5 GROUPFILE=/etc/group
6
7 frruid=`egrep "^frr:" $PASSWDFILE | awk -F ":" '{ print $3 }'`
8 frrgid=`egrep "^frr:" $GROUPFILE | awk -F ":" '{ print $3 }'`
9 frrvtygid=`egrep "^frrvty:" $GROUPFILE | awk -F ":" '{ print $3 }'`
10
11 [ -n ${frruid} ] || (echo "No uid for frr in ${PASSWDFILE}" && /bin/false)
12 [ -n ${frrgid} ] || (echo "No gid for frr in ${GROUPFILE}" && /bin/false)
13 [ -n ${frrVTYgid} ] || (echo "No gid for frrvty in ${GROUPFILE}" && /bin/false)
14
15 chown -R ${frruid}:${frrgid} /etc/frr
16 touch /etc/frr/vtysh.conf
17 chgrp ${frrvtygid} /etc/frr/vtysh*
18 chmod 644 /etc/frr/*
19
20 ENVIRONMENTFILE=/etc/environment
21 if ! grep --quiet VTYSH_PAGER=/bin/cat ${ENVIRONMENTFILE}; then
22 echo "VTYSH_PAGER=/bin/cat" >> ${ENVIRONMENTFILE}
23 fi
24 ##################################################
25
26 if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
27 ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"}
28
29 # This is most likely due to the answer "no" to the "really stop the server"
30 # question in the prerm script.
31 if [ "$1" = "abort-upgrade" ]; then
32 exit 0
33 fi
34
35 . /usr/share/debconf/confmodule
36
37 db_stop
38
39 if [ -x "/etc/init.d/frr" ] || [ -e "/etc/init/frr.conf" ]; then
40 if [ ! -e "/etc/init/frr.conf" ]; then
41 update-rc.d frr defaults >/dev/null
42 fi
43 invoke-rc.d frr start || exit $?
44 fi
45
46 #DEBHELPER#
47