summarylogtreecommitdiffstats
path: root/gincamalarm.install
blob: 71c3574796e6d0148f7088b48d8c58e8baf3e626 (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
41
42
43
44
post_install() {
    pkgname=gincamalarm

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

    # Reload systemctl
    systemctl daemon-reload

    echo "Adding gincamalarm in systemctl:"
    echo "  systemctl enable gincamalarm"
    echo "  systemctl start gincamalarm"

    echo "Adding this rule in iptables:"
    echo "  iptables -t filter -A INPUT -p tcp --dport 8090 -j ACCEPT"

    echo "If you use tmpfs method, you must create it and it will be mounted automatically with fstab"

    true
}

post_upgrade() {
    # Reload systemctl
    systemctl daemon-reload

    echo "You should restart gincamalarm"
    echo "  systemctl restart gincamalarm"
    echo "If you use tmpfs method, you must create it and it will be mounted automatically with fstab"

    true
}

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

    true
}