sputnik-browser.sh 1.44 KB
Newer Older
1 2
#!/bin/sh

3
PKGNAME=sputnik-browser-stable
4
SUPPORTEDARCHES="x86_64"
5
DESCRIPTION="Sputnik browser from the official site"
6

7
. $(dirname $0)/common.sh
8 9


10 11 12 13 14
url_by_id_content()
{
    local id_content="$1"
    epm tool eget -q -O- https://sputnik-lab.com/api-updates/updates/apps/meta?channel=b2c-distrs-on-site | grep -A6 "$id_content" | tail -n1 | sed -e 's|.*"url": "||' -e 's|".*||'
}
15 16 17

case "$($DISTRVENDOR -e)" in
    Ubuntu/20.04)
18
        id_content='browser-b2c-ubuntu20-id'
19 20
        ;;
    Ubuntu/16.04)
21
        id_content='browser-b2c-ubuntu-id'
22 23
        ;;
    Ubuntu/*)
24
        id_content='browser-b2c-ubuntu20-id'
25 26
        ;;
    ALTLinux/c8)
27
        id_content='browser-b2c-alt-id'
28
        ;;
29
    ALTLinux/*|ALTServer/*)
30 31 32 33
        id_content='browser-b2c-alt9-id'
        ;;
    AstraLinux/orel)
        id_content='browser-b2c-astrase-id'
34 35
        ;;
    AstraLinux/*)
36
        id_content='browser-b2c-astrace-id'
37 38
        ;;
    RedOS/*)
39
        id_content='browser-b2c-redos-id'
40 41
        ;;
    RosaLinux/*)
42
        id_content='browser-b2c-rosa-id'
43 44
        ;;
    Windows/*)
45 46 47 48
        id_content='browser-b2c-win-id'
        ;;
    *)
        fatal "Unsupported system $($DISTRVENDOR -e)"
49 50
        ;;
esac
51

52 53
epm install $(url_by_id_content $id_content)

54 55 56 57 58 59 60
ERR=$?
if [ "$ERR" = 0 ] ; then
    echo "Running # /opt/sputnik-browser/sputnik_client --generate_branding to get license in config.dat"
    a='' $SUDO /opt/sputnik-browser/sputnik_client --generate_branding
fi

exit $ERR