summarylogtreecommitdiffstats
path: root/trezor-bridge-bin.install
blob: 921aaa610e364c2a88dca3746e5296bb9d0c41f1 (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
pre_install(){
    getent group trezord >/dev/null || groupadd -r trezord
    getent group plugdev >/dev/null || groupadd -r plugdev
    getent passwd trezord >/dev/null || useradd -r -g trezord -G plugdev -M -s /usr/bin/nologin -c "TREZOR Bridge" trezord
}

post_install() {
    systemctl daemon-reload
    systemctl enable --now trezord.service
}

pre_upgrade() {
    systemctl stop trezord.service
}

post_upgrade() {
    systemctl daemon-reload
    systemctl start trezord.service
}

pre_remove() {
    systemctl stop trezord.service
    systemctl disable trezord.service
}

post_remove() {
    getent passwd trezord >/dev/null && userdel trezord
    getent group trezord >/dev/null && groupdel trezord
}