File: motion.postinst

package info (click to toggle)
motion 3.2.12%2Bgit20140228-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,240 kB
  • ctags: 2,370
  • sloc: ansic: 25,224; makefile: 687; sh: 278
file content (44 lines) | stat: -rw-r--r-- 767 bytes parent folder | download
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
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
# postinst script for motion
# Made by Angel Carpintero

set -e


. /usr/share/debconf/confmodule

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

add_user_if_missing() {
    if [ -x /usr/sbin/adduser ]; then
        if ! id -u motion > /dev/null 2>&1; then
            adduser --system --home /var/lib/motion \
		--disabled-password \
		--force-badname motion \
		--ingroup motion
	    adduser motion video
        fi
    fi
}

add_group_if_missing
add_user_if_missing

# Fix motion.conf permission
chmod 0640 /etc/motion/motion.conf
chgrp motion /etc/motion/motion.conf


db_stop

#DEBHELPER#

exit 0