summarylogtreecommitdiffstats
path: root/firefish.install
blob: affe1cba6b57a28e75571ca110c34f2ec2cea692 (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
post_install() {
    printf "You've successfully installed firefish!\n"
    if ! [ -f "/etc/webapps/firefish/default.yml" ]; then
        cp "/etc/webapps/firefish/example.yml" "/etc/webapps/firefish/default.yml"
        fi
    printf "More on the setup: https://wiki.archlinux.org/title/Calckey\n"
}

## $1: new package version
## $2: old package version
pre_upgrade() {
    ## Ignore reinstallations of the same or older versions
    if [ $(vercmp $1 $2) -gt 0 ] ; then
        ## Shut down the firefish service before touching it's files
        if systemctl is-active firefish.service > /dev/null; then
            printf "Shutting down firefish\n"
            systemctl stop firefish.service
        fi
    fi
}

post_upgrade() {
    ## Ignore reinstallations of the same or older versions
    if [ $(vercmp $1 $2) -gt 0 ] ; then
        /usr/bin/firefish -m
    fi
}