summaryrefslogtreecommitdiff
path: root/ipadm/debian/ipadm.postinst
blob: 499c3c2e48be6475d8a2ca28498cb9c5f230282d (plain)
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
#!/bin/sh

set -e

configure() {
    if [ ! -e /etc/ipadm ]; then
        echo "Creating /etc/ipadm"
        mkdir /etc/ipadm
    fi

    # ipmgmtd is so stupid:
    if [ ! -e /etc/ipadm/ipadm.conf ]; then
        echo "Creating initial (empty) /etc/ipadm/ipadm.conf"
        touch /etc/ipadm/ipadm.conf
    fi

    # netadm user and group are system ones,
    # defined in base-passwd. It is specific to illumos.
    chown -R netadm:netadm /etc/ipadm
    chmod 0755 /etc/ipadm
    chmod 0644 /etc/ipadm/*
}

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

exit 0