Debian Codegraph @

debian/osmo-cbc.postinst

raw
1 #!/bin/sh
2
3 set -e
4
5 add_users_groups()
6 {
7 if ! getent user osmocom-cbc >/dev/null; then
8 adduser --disabled-password --no-create-home --home /run/osmocom --quiet --system --group osmo-cbc
9 fi
10 }
11
12 add_statoverrides()
13 {
14 OVERRIDES="
15 /etc/osmocom/osmo-cbc.cfg
16 "
17
18 for f in ${OVERRIDES}; do
19 if ! dpkg-statoverride --list "${dir}" >/dev/null 2>&1; then
20 [ ! -e "${f}" ] || chown osmo-cbc:osmo-cbc "${f}"
21 fi
22 done
23 }
24
25 case "$1" in
26 configure)
27 add_users_groups
28 add_statoverrides
29 ;;
30 abort-upgrade|abort-remove|abort-deconfigure)
31 ;;
32 *)
33 echo "postinst called with unknown argument \`$1'" >&2
34 exit 1
35 ;;
36 esac
37
38 #DEBHELPER#
39