File: motion.postinst

package info (click to toggle)
motion 4.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 4,020 kB
  • sloc: ansic: 26,372; makefile: 83; sh: 59
file content (34 lines) | stat: -rw-r--r-- 652 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# postinst script for motion
# Made by Angel Carpintero

set -e

. /usr/share/debconf/confmodule

add_group_if_missing() {
    if ! getent group motion >/dev/null; then
        addgroup --system --force-badname motion || true
    fi
}

add_user_if_missing() {
    if ! id -u motion > /dev/null 2>&1; then
        mkdir -m 02750 -p /var/lib/motion
        adduser --system --home /var/lib/motion \
          --disabled-password \
          --force-badname motion \
          --ingroup motion
        adduser motion video
        chown motion:adm /var/lib/motion
    fi
}

add_group_if_missing
add_user_if_missing

db_stop

#DEBHELPER#

exit 0