summarylogtreecommitdiffstats
path: root/trueconf-client.install
blob: 21d2c1e4e09b4bb20e5abcd172ee0b7d6e454d05 (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
post_install() {
    chmod a+x /opt/trueconf/client/trueconf
    chmod a+x /opt/trueconf/client/trueconf-autostart
    
    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
}