]>
git.proxmox.com Git - mirror_frr.git/blob - debian/quagga.preinst
3 if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE
=1; fi
4 ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"}
8 # creating quaggavty group if it isn't already there
9 if ! getent group quaggavty
>/dev
/null
; then
10 addgroup
--system quaggavty
>/dev
/null
13 # creating quagga group if it isn't already there
14 if ! getent group quagga
>/dev
/null
; then
15 addgroup
--system quagga
>/dev
/null
18 # creating quagga user if he isn't already there
19 if ! getent passwd quagga
>/dev
/null
; then
23 --home /var
/run
/quagga
/ \
24 --gecos "Quagga routing suite" \
29 # We may be installing over an older version of
30 # quagga and as such we need to intelligently
31 # check to see if the quagga user is in the quaggavty
33 if ! /usr
/bin
/id quagga |
grep &>/dev
/null
'quaggavty'; then
34 usermod
-a -G quaggavty quagga
>/dev
/null
37 # Do not change permissions when upgrading as it would violate policy.
38 if [ "$1" = "install" ]; then
39 # Logfiles are group readable in case users were put into the quagga group.
42 chown
-R quagga
:quagga
$d
44 find $d -type f
-print0 |
xargs -0 --no-run-if-empty chmod u
=rw
,g
=r
,o
=
46 # Strict permissions for the sockets.
49 chown
-R quagga
:quagga
$d
51 find $d -type f
-print0 |
xargs -0 --no-run-if-empty chmod u
=rw
,go
=
53 # Config files. Vtysh does not have access to the individual daemons config file
56 chown quagga
:quaggavty
$d
58 find $d -type f
-print0 |
xargs -0 --no-run-if-empty chown quagga
:quagga
59 find $d -type f
-print0 |
xargs -0 --no-run-if-empty chmod u
=rw
,g
=r
,o
=
61 # Exceptions for vtysh.
64 chown quagga
:quaggavty
$f
68 # Exceptions for vtysh.
70 if [ -f $d/Zebra.conf
]; then
74 chown quagga
:quaggavty
$f