summarylogtreecommitdiffstats
path: root/trueconf.install
blob: ec05ce8bf6c76aea701003b5808bbba429e1d4a3 (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
41
42
43
44
45
46
post_install() {
    chmod a+x /opt/trueconf/client/trueconf
    chmod a+x /opt/trueconf/client/trueconf-autostart
    chmod a+x /opt/trueconf/client/qt5/libexec/QtWebEngineProcess

    ln -f -s /opt/trueconf/client/trueconf /usr/bin/trueconf

    if command -v "xdg-desktop-menu" >/dev/null 2>&1; then
        xdg-desktop-menu install --novendor --mode system /usr/share/applications/trueconf.desktop > /dev/null 2>&1 || true
    fi
    update-desktop-database > /dev/null 2>&1 || true

    binpid=$(ps axco pid,command | awk '$2 == "TrueConf" {print $1; }')
    if [ -n "$binpid" ]; then
        for process in $binpid; do
            kill -s 50 "$process" 
        done
    fi

    startupbin=$(ps axco pid,command | awk '$2 == "trueconf" {print $1; }')
    if [ -n "$startupbin" ]; then
        for process in $startupbin; do
            kill -s 50 "$process "
        done
    fi
}

post_upgrade() {
    post_install
}

pre_remove() {
    binpid=$(ps axco pid,command | awk '$2 == "TrueConf" {print $1; }')
    if [ -n "$binpid" ]; then
        for process in $binpid; do
            kill "$process" 
        done
    fi

    startupbin=$(ps axco pid,command | awk '$2 == "trueconf" {print $1; }')
    if [ -n "$startupbin" ]; then
        for process in $startupbin; do
            kill "$process"
        done
    fi
}