sputnik-browser.sh 1.43 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
URL="https://sputnik-lab.com/api-updates/updates/apps/meta?channel=b2c-distrs-on-site"
12

13 14 15
url_by_id_content()
{
    local id_content="$1"
16
    epm tool eget -q -O- "$URL" | grep -A6 "$id_content" | tail -n1 | sed -e 's|.*"url": "||' -e 's|".*||'
17
}
18

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

52
epm install $(url_by_id_content "browser-b2c-$id_content")
53

54 55 56
ERR=$?
if [ "$ERR" = 0 ] ; then
    echo "Running # /opt/sputnik-browser/sputnik_client --generate_branding to get license in config.dat"
57
    esu /opt/sputnik-browser/sputnik_client --generate_branding
58 59
    echo "Disable strange system service sputnik_client"
    serv sputnik_client off
60
    esu killall sputnik_client
61 62 63
fi

exit $ERR