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) |
| 19 | chown osmocom:osmocom /etc/osmocom/osmo-msc.cfg |
| 20 | chmod 0660 /etc/osmocom/osmo-msc.cfg |
| 21 | chown root:osmocom /etc/osmocom |
| 22 | chmod 2775 /etc/osmocom |
| 23 | mkdir -p /var/lib/osmocom |
| 24 | chown -R osmocom:osmocom /var/lib/osmocom |
| 25 | ;; |
Max | 62e16d3 | 2022-10-12 16:15:25 +0300 | [diff] [blame] | 26 | esac |
| 27 | |
| 28 | # dh_installdeb(1) will replace this with shell code automatically |
| 29 | # generated by other debhelper scripts. |
| 30 | #DEBHELPER# |