summarylogtreecommitdiffstats
path: root/trueconf-client.install
blob: a69e58f85e142f82ea59b1c71f917677f9aeb442 (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/trueconf
    chmod a+x /opt/trueconf/trueconf-autostart
    
    ln -f -s /opt/trueconf/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
}

pre_remove() {
    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
}