summarylogtreecommitdiffstats
path: root/hermes.install
blob: c7ea5d9dd6dd2ac7a19a2df0a72920c830f9e875 (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
30
31
32
post_install() {
    # <Group>
    groupadd hermes || true

    # <Folder>
    mkdir -p /etc/hermes
    chown root:root /etc/hermes
    chmod 500 /etc/hermes

    # <Systemd>
    systemctl enable hermes.service

    # <PAM>
    sed -i '2i\auth sufficient pam_hermes.so\
' /etc/pam.d/system-auth
}

pre_remove() {
    # </Systemd>
    systemctl disable hermes.service
}

post_remove() {
    # </Group>
    groupdel hermes || true

    # </Folder>
    rm -rf /etc/hermes

    # </PAM>
    sed 's/^.*pam_hermes.*$//' /etc/pam.d/system-auth
}