File: gpsd.postinst

package info (click to toggle)
gpsd 3.22-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 27,508 kB
  • sloc: ansic: 57,097; xml: 15,491; python: 12,716; cpp: 836; sh: 699; php: 210; makefile: 188; perl: 111; javascript: 26
file content (27 lines) | stat: -rw-r--r-- 652 bytes parent folder | download | duplicates (4)
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
#!/bin/bash
# postinst script for gpsd

set -e

if [ "$1" = "configure" ] ; then

    echo "Creating/updating gpsd user account..."
    adduser --system --ingroup dialout --home /run/gpsd \
            --gecos "GPSD system user" --shell /bin/false \
            --quiet --disabled-password gpsd || {
        # adduser failed. Why?
        if getent passwd gpsd >/dev/null ; then
            echo "Non-system user gpsd found. I will not overwrite a non-system" >&2
            echo "user.  Remove the user and reinstall gpsd." >&2
            exit 1
        fi
        # unknown adduser error, simply exit
        exit 1
    }


fi

#DEBHELPER#

exit 0