This file is indexed.

preinst is in quagga 0.99.24.1-2ubuntu1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash

if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"}
set -e
set -u

# creating quaggavty group if it isn't already there
if ! getent group quaggavty >/dev/null; then
        addgroup --system quaggavty >/dev/null
fi

# creating quagga group if it isn't already there
if ! getent group quagga >/dev/null; then
        addgroup --system quagga >/dev/null
fi

# creating quagga user if he isn't already there
if ! getent passwd quagga >/dev/null; then
        adduser \
          --system \
          --ingroup quagga \
          --home /var/run/quagga/ \
          --gecos "Quagga routing suite" \
          --shell /bin/false \
          quagga  >/dev/null
fi

# Do not change permissions when upgrading as it would violate policy.
if [ "$1" = "install" ]; then
  # Logfiles are group readable in case users were put into the quagga group.
  d=/var/log/quagga/
    mkdir -p $d
    chown -R quagga:quagga $d
    chmod u=rwx,go=rx $d
    find $d -type f -print0 | xargs -0 --no-run-if-empty   chmod u=rw,g=r,o=

  # Strict permissions for the sockets.
  d=/var/run/quagga/
    mkdir -p $d
    chown -R quagga:quagga $d
    chmod u=rwx,go=rx $d
    find $d -type f -print0 | xargs -0 --no-run-if-empty   chmod u=rw,go=

  # Config files. Vtysh does not have access to the individual daemons config file
  d=/etc/quagga/
    mkdir -p $d
    chown quagga:quaggavty $d
    chmod ug=rwx,o=rx $d
    find $d -type f -print0 | xargs -0 --no-run-if-empty   chown quagga:quagga
    find $d -type f -print0 | xargs -0 --no-run-if-empty   chmod u=rw,g=r,o=

    # Exceptions for vtysh.
    f=$d/vtysh.conf
    if [ -f $f ]; then
      chown quagga:quaggavty $f
      chmod u=rw,g=r,o= $f
    fi

    # Exceptions for vtysh.
    f=$d/Quagga.conf
    if [ -f $d/Zebra.conf ]; then
      mv $d/Zebra.conf $f
    fi
    if [ -f $f ]; then
      chown quagga:quaggavty $f
      chmod u=rw,g=r,o= $f
    fi
fi

# No -q so that the filename is displayed. But on stderr due to debhelper.
if grep ^smux /etc/quagga/*.conf >&2 2>/dev/null; then
  echo "The currently used smux options will no longer work so remove them!" >&2
  echo "See /usr/share/doc/quagga/README.Debian for more information." >&2
  exit 1
fi