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

3
PKGNAME=sputnik-browser-stable
4
SUPPORTEDARCHES="x86_64"
5 6 7
# discontinued
# https://bugzilla.altlinux.org/43495
#DESCRIPTION="Sputnik browser from the official site"
8

9
. $(dirname $0)/common.sh
10

11 12 13 14 15
URL="https://sputnik-lab.com/api-updates/updates/apps/meta?channel=b2c-distrs-on-site"
if ! check_url_is_accessible "$URL" ; then
    epm tool eget -O- "$URL"
    fatal "Please, check why $URL is not accessible"
fi
16

17 18 19
url_by_id_content()
{
    local id_content="$1"
20
    epm tool eget -q -O- "$URL" | grep -A6 "$id_content" | tail -n1 | sed -e 's|.*"url": "||' -e 's|".*||'
21
}
22 23 24

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

56
epm install $(url_by_id_content "browser-b2c-$id_content")
57

58 59 60 61 62 63 64
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