blob: be12373796137b5e7402eb7d47d7671b27b5f542 [file] [log] [blame]
Oliver Smithe0fc37a2024-05-10 16:14:49 +02001#!/bin/sh -e
2case "$1" in
3 configure)
4 # Create the osmocom group and user (if it doesn't exist yet)
5 if ! getent group osmocom >/dev/null; then
6 groupadd --system osmocom
7 fi
8 if ! getent passwd osmocom >/dev/null; then
9 useradd \
10 --system \
11 --gid osmocom \
12 --home-dir /var/lib/osmocom \
13 --shell /sbin/nologin \
14 --comment "Open Source Mobile Communications" \
15 osmocom
16 fi
17
18 # Fix permissions of previous (root-owned) install (OS#4107)
19 if dpkg --compare-versions "$2" le "1.13.0"; then
20 if [ -e /etc/osmocom/osmo-mgw.cfg ]; then
21 chown -v osmocom:osmocom /etc/osmocom/osmo-mgw.cfg
22 chmod -v 0660 /etc/osmocom/osmo-mgw.cfg
23 fi
24
25 if [ -d /etc/osmocom ]; then
26 chown -v root:osmocom /etc/osmocom
27 chmod -v 2775 /etc/osmocom
28 fi
29
30 mkdir -p /var/lib/osmocom
31 chown -R -v osmocom:osmocom /var/lib/osmocom
32 fi
33 ;;
34esac
35
36# dh_installdeb(1) will replace this with shell code automatically
37# generated by other debhelper scripts.
38#DEBHELPER#