Statistics
| Branch: | Tag: | Revision:

root / debian / postinst @ c5654215

History | View | Annotate | Download (939 Bytes)

1
#!/bin/sh -e
2

    
3
setup_vncauthproxy_user() {
4
	if ! getent group vncauthproxy >/dev/null; then
5
		addgroup --system --quiet vncauthproxy
6
	fi
7

    
8
	if ! getent passwd vncauthproxy >/dev/null; then
9
		adduser --quiet --system --no-create-home --home /var/run/vncauthproxy --ingroup vncauthproxy --shell /usr/sbin/nologin vncauthproxy
10
	fi
11

    
12
}
13

    
14
setup_vncauthproxy_user
15

    
16
case "$1" in
17
    configure)
18
        if [ ! -s /var/lib/vncauthproxy/users ]
19
        then
20
            echo "Configure a vncauthproxy user:"
21

    
22
            read -p "User: " user
23
            if [ "x$user" = "x" ]
24
            then
25
                echo "cannot add empty user, aborting" >&2
26
                exit 1
27
            fi
28

    
29
            vncauthproxy-passwd /var/lib/vncauthproxy/users $user
30
        fi
31
    ;;
32

    
33
    abort-upgrade|abort-remove|abort-deconfigure)
34
    ;;
35

    
36
    *)
37
        echo "postinst called with unknown argument \`$1'" >&2
38
        exit 1
39
    ;;
40
esac
41

    
42
#DEBHELPER#
43

    
44
exit 0