summarylogtreecommitdiffstats
path: root/keybase-gui.in
blob: 22c5e3a4e3218284b7bd4105ab001854f3c927aa (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
#!/bin/bash

keybase ctl init

if ! keybase version --assert-matching &>/dev/null; then
    echo "Keybase was updated, restarting services" >&2
    set -x
    systemctl --user daemon-reload
    systemctl --user restart keybase kbfs
    { set +x; } &>/dev/null
else
    systemctl --user start keybase kbfs
fi

if (( $# )) || systemctl --user is-active --quiet keybase.gui; then
    exec @electron@ /usr/share/keybase-app "$@"
else
    if [[ ${KEYBASE_AUTOSTART+set} ]]; then
        systemctl --user import-environment KEYBASE_AUTOSTART
    else
        systemctl --user unset-environment KEYBASE_AUTOSTART
    fi
    exec systemctl --user start --wait keybase.gui
fi