summarylogtreecommitdiffstats
path: root/flickmagnet.install
blob: 667cc11bf0746b0d9d72575ccb8752fd4db58c2e (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() {
    getent passwd flickmagnet &>/dev/null || {
        echo -n ">>> Adding user... "
        useradd --user-group --home /srv/flickmagnet -u 420 -s /bin/false flickmagnet
        echo "done"
    }
    chown flickmagnet:flickmagnet /srv/flickmagnet

    cat <<EOF

>>> Start the daemon with 'systemctl start flickmagnet'
    It starts as the "flickmagnet" user, with files stored in /srv/flickmagnet

>>> Then open in your browser:

    http://localhost:42000/

EOF
}

pre_remove() {
    systemctl stop flickmagnet
}

post_remove() {
    getent passwd flickmagnet &>/dev/null && {
        echo -n ">>> Deleting user... "
        userdel flickmagnet -fr
        echo "done"
    }
}

post_upgrade() {
    echo ">>> Flick Magnet doesn't have graceful upgrades yet, delete user files to reinitialize:"
    echo "    rm -r ~/.config/flickmagnet/ ~/.cache/flickmagnet/ ~/.local/share/flickmagnet/"

    systemctl daemon-reload
}