summarylogtreecommitdiffstats
path: root/port-forward.install
blob: 19a18fdb8b28e40a0e3971f1cbb4c37d208f4d6a (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
post_install() {
    systemd-sysusers 2>/dev/null || true
    systemd-tmpfiles --create 2>/dev/null || true
    echo ""
    echo "Port Forward Manager v$pkgver installed!"
    echo ""
    echo "Configuration files:"
    echo "  /etc/port-forward/port-forward.conf"
    echo "  /etc/port-forward/ports.conf"
    echo ""
    echo "To start the service:"
    echo "  sudo systemctl start port-forward"
    echo ""
    echo "To enable at boot:"
    echo "  sudo systemctl enable port-forward"
    echo ""
    echo "Documentation: $url"
}

post_upgrade() {
    systemd-sysusers 2>/dev/null || true
    systemd-tmpfiles --create 2>/dev/null || true
    systemctl daemon-reload
    if systemctl is-active --quiet port-forward; then
        systemctl restart port-forward
    fi
}

post_remove() {
    if systemctl is-active --quiet port-forward; then
        systemctl stop port-forward
    fi
    systemctl daemon-reload
}