File: postinst

package info (click to toggle)
tinyproxy 1.8.4-3~deb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,552 kB
  • sloc: ansic: 5,841; sh: 4,366; perl: 347; makefile: 156
file content (28 lines) | stat: -rw-r--r-- 697 bytes parent folder | download
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
#!/bin/sh

set -e

# Create a tinyproxy system group
if ! getent group tinyproxy > /dev/null; then
    addgroup --quiet --system tinyproxy
fi

# Create a tinyproxy system user
if ! getent passwd tinyproxy > /dev/null; then
    adduser --quiet --system \
        --ingroup tinyproxy \
        --home /run/tinyproxy \
        --disabled-password --shell /bin/false \
        tinyproxy
    usermod -c "Tinyproxy daemon" tinyproxy
fi

# Make sure /var/log/tinyproxy is writable by the tinyproxy user
if [ "$1" = "configure" ]; then
    if dpkg --compare-versions "$2" lt "1.8.4-2~"; then
        chmod -R 750 /var/log/tinyproxy
        chown -R tinyproxy:adm /var/log/tinyproxy
    fi
fi

#DEBHELPER#