guardant.sh 922 Bytes
Newer Older
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 41
#!/bin/sh

PKGNAME=glds
SUPPORTEDARCHES="x86_64"
VERSION="$2"
DESCRIPTION="Guardant License Server from the official site"
URL="https://www.guardant.ru/support/users/download/1223/"

. $(dirname $0)/common.sh

[ "$VERSION" = "*" ] && VERSION="$(basename $(epm tool eget --list --latest https://download.guardant.ru/LM/Linux/ '*/'))"

shortarch=x64

pkgtype="$(epm print info -p)"

case "$pkgtype" in
    rpm)
        file="glds-*.x86_64.rpm"
        ;;
    deb)
        file="glds-*_x86_64.deb"
        ;;
    *)
        file="glds-*_x86_64.deb"
        ;;
esac

PKGURL=$(epm tool eget --list --latest https://download.guardant.ru/LM/Linux/$VERSION/$shortarch/ "$file") || fatal "Can't get package URL"

repack=''
[ "$(epm print info -s)" = "alt" ] && repack='--repack'

epm pack $PKGNAME $repack --install "$PKGURL" "$VERSION" || exit

cat <<EOF

Note: run
# serv glds on
to start Guardant License Server permanently
EOF