File: postinst

package info (click to toggle)
orthanc 0.8.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,112 kB
  • ctags: 5,342
  • sloc: cpp: 33,492; ansic: 3,770; python: 548; xml: 167; sh: 148; sql: 101; makefile: 44
file content (32 lines) | stat: -rwxr-xr-x 901 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
#!/bin/sh

set -e

case $1 in
    configure)
        # Add the "orthanc" user
        if ! getent passwd orthanc > /dev/null; then
            adduser --system --quiet \
                --home /var/lib/orthanc --no-create-home \
                --shell /bin/bash --group --gecos "Orthanc Administrator" orthanc
        fi
        if test "`id -u orthanc`" -eq 0; then
            echo "The orthanc administrative user must not be root." >&2
            false
        fi
        if test "`id -g orthanc`" -eq 0; then
            echo "The orthanc administrative group must not be root." >&2
            false
        fi

        # Create the required directories
        chown -R orthanc:orthanc /etc/orthanc
        chown -R orthanc:orthanc /var/lib/orthanc
        chmod 0775 /etc/orthanc
        chmod 0775 /var/lib/orthanc

        chmod 0664 /etc/orthanc/orthanc.json
        ;;
esac

#DEBHELPER#