Max | 62e16d3 | 2022-10-12 16:15:25 +0300 | [diff] [blame] | 1 | #!/bin/sh -e |
Max | 62e16d3 | 2022-10-12 16:15:25 +0300 | [diff] [blame] | 2 | case "$1" in |
Oliver Smith | 5a14065 | 2024-04-26 15:08:45 +0200 | [diff] [blame] | 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 |
Max | 62e16d3 | 2022-10-12 16:15:25 +0300 | [diff] [blame] | 17 | |
Oliver Smith | 5a14065 | 2024-04-26 15:08:45 +0200 | [diff] [blame] | 18 | # Fix permissions of previous (root-owned) install (OS#4107) |
Oliver Smith | 46f1069 | 2024-05-14 15:21:05 +0200 | [diff] [blame] | 19 | 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 Smith | 5a14065 | 2024-04-26 15:08:45 +0200 | [diff] [blame] | 33 | ;; |
Max | 62e16d3 | 2022-10-12 16:15:25 +0300 | [diff] [blame] | 34 | esac |
| 35 | |
| 36 | # dh_installdeb(1) will replace this with shell code automatically |
| 37 | # generated by other debhelper scripts. |
| 38 | #DEBHELPER# |