blob: 46cd851f87a9c3e5a71a67a885ecf48d5d7fbb86 [file] [log] [blame]
Max62e16d32022-10-12 16:15:25 +03001#!/bin/sh -e
Max62e16d32022-10-12 16:15:25 +03002case "$1" in
Oliver Smith5a140652024-04-26 15:08:45 +02003 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
Max62e16d32022-10-12 16:15:25 +030017
Oliver Smith5a140652024-04-26 15:08:45 +020018 # Fix permissions of previous (root-owned) install (OS#4107)
Oliver Smith46f10692024-05-14 15:21:05 +020019 if dpkg --compare-versions "$2" le "1.12.0"; then
20 if [ -e /etc/osmocom/osmo-msc.cfg ]; then
21 chown -v osmocom:osmocom /etc/osmocom/osmo-msc.cfg
22 chmod -v 0660 /etc/osmocom/osmo-msc.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
Oliver Smith5a140652024-04-26 15:08:45 +020033 ;;
Max62e16d32022-10-12 16:15:25 +030034esac
35
36# dh_installdeb(1) will replace this with shell code automatically
37# generated by other debhelper scripts.
38#DEBHELPER#