summarylogtreecommitdiffstats
path: root/pingormail.install
blob: 480521e841af60a30f2fdd1afe29ea83b12ef53f (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
33
34
35
36
37
38
39
40
post_install() {
    pkgname=pingormail

    # Fixing membership
    chown http: /var/log/$pkgname
    chown -R http: /etc/$pkgname

    # Reload systemctl
    systemctl daemon-reload

    echo "Adding pingormail in systemctl if you want always use it:"
    echo "  systemctl enable pingormail"
    echo "  systemctl start pingormail"
    echo "Adding pingormail.timer in systemctl if you want use it in onshot mode:"
    echo "  systemctl enable pingormail.timer"
    echo "  systemctl start pingormail.timer"

    true
}

post_upgrade() {
    # Reload systemctl
    systemctl daemon-reload

    true
}

pre_remove() {
    pkgname=pingormail
    # Remove symlink in systemd
    systemctl disable "$pkgname"
    systemctl disable "$pkgname".timer
    # Stop server
    systemctl stop "$pkgname"
    systemctl stop "$pkgname".timer
    # Reload systemctl
    systemctl daemon-reload

    true
}