Commit 80a958ff authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play sputnik-browser: cleanup, add verbose checking URI accessible

parent 02262940
...@@ -6,50 +6,55 @@ DESCRIPTION="Sputnik browser from the official site" ...@@ -6,50 +6,55 @@ DESCRIPTION="Sputnik browser from the official site"
. $(dirname $0)/common.sh . $(dirname $0)/common.sh
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
url_by_id_content() url_by_id_content()
{ {
local id_content="$1" 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|".*||' epm tool eget -q -O- "$URL" | grep -A6 "$id_content" | tail -n1 | sed -e 's|.*"url": "||' -e 's|".*||'
} }
case "$($DISTRVENDOR -e)" in case "$($DISTRVENDOR -e)" in
Ubuntu/20.04) Ubuntu/20.04)
id_content='browser-b2c-ubuntu20-id' id_content='ubuntu20-id'
;; ;;
Ubuntu/16.04) Ubuntu/16.04)
id_content='browser-b2c-ubuntu-id' id_content='ubuntu-id'
;; ;;
Ubuntu/*) Ubuntu/*)
id_content='browser-b2c-ubuntu20-id' id_content='ubuntu20-id'
;; ;;
ALTLinux/c8) ALTLinux/c8)
id_content='browser-b2c-alt-id' id_content='alt-id'
;; ;;
ALTLinux/*|ALTServer/*) ALTLinux/*|ALTServer/*)
id_content='browser-b2c-alt9-id' id_content='alt9-id'
;; ;;
AstraLinux/orel) AstraLinux/smolensk)
id_content='browser-b2c-astrase-id' id_content='astrase-id'
;; ;;
AstraLinux/*) AstraLinux/*)
id_content='browser-b2c-astrace-id' id_content='astrace-id'
;; ;;
RedOS/*) RedOS/*)
id_content='browser-b2c-redos-id' id_content='redos-id'
;; ;;
RosaLinux/*) RosaLinux/*)
id_content='browser-b2c-rosa-id' id_content='rosa-id'
;; ;;
Windows/*) Windows/*)
id_content='browser-b2c-win-id' id_content='win-id'
;; ;;
*) *)
fatal "Unsupported system $($DISTRVENDOR -e)" fatal "Unsupported system $($DISTRVENDOR -e)"
;; ;;
esac esac
epm install $(url_by_id_content $id_content) epm install $(url_by_id_content "browser-b2c-$id_content")
ERR=$? ERR=$?
if [ "$ERR" = 0 ] ; then if [ "$ERR" = 0 ] ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment