File: postinst

package info (click to toggle)
cubemap 1.4.3-2
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 848 kB
  • sloc: ansic: 8,155; cpp: 5,611; sh: 114; perl: 112; makefile: 63
file content (35 lines) | stat: -rw-r--r-- 694 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
set -e

set_perms() {
  USER=$1
  GROUP=$2
  MODE=$3
  FILE=$4
  if ! dpkg-statoverride --list $FILE > /dev/null 2>&1; then
    chown $USER:$GROUP $FILE
    chmod $MODE $FILE
  fi
}

case "$1" in
  configure)
    if ! getent passwd cubemap >/dev/null; then
      adduser --disabled-password  --quiet --system \
        --home /var/lib/cubemap --no-create-home \
        --gecos "Cubemap daemon" --group cubemap
    fi
    set_perms cubemap cubemap 755 /var/lib/cubemap
    set_perms cubemap cubemap 755 /var/log/cubemap
  ;;
  abort-upgrade|abort-remove|abort-deconfigure)
  ;;
  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
  ;;
esac

#DEBHELPER#

exit 0