summarylogtreecommitdiffstats
path: root/nomachine-client.install
blob: ff2aaa9590ab2d12603391aac0e9f0fc91b3b3a0 (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
_invoke() {
    # arg1: --install | --update | --uninstall
    # NX_INSTALL_DEBUG=1
    NX_INSTALL_PREFIX=/usr/share /usr/share/NX/scripts/setup/nxplayer "$1" arch
}


_check_remove_old_prefix()
{
    if [ -d /usr/NX ]; then
        echo "Old installation (/usr) found, removing"

        if [ -x /usr/NX/scripts/setup/nxclient ]; then
            NX_INSTALL_PREFIX=/usr /usr/NX/scripts/setup/nxplayer --uninstall fedora
        fi

        rm -rf /usr/NX
    fi
}

post_install()
{   
    echo "Running NX post_install script ..."
    _invoke --install
}

pre_remove()
{
    echo "Running NX pre_remove script ..."
    _invoke --uninstall
}


post_upgrade()
{
    echo "Running NX post_upgrade script ..."
    _check_remove_old_prefix
    chmod +x /usr/share/NX/scripts/restricted/nxusb.sh || true
    _invoke --update
}