virtualhere.sh 1.17 KB
Newer Older
1 2 3 4
#!/bin/sh

PKGNAME=virtualhere
SUPPORTEDARCHES="x86_64 armhf mips mipsel aarch64 x86"
5
VERSION="$2"
6
DESCRIPTION='Generic VirtualHere USB Server from the official site'
7
URL="https://www.virtualhere.com/"
8 9 10

. $(dirname $0)/common.sh

11 12
warn_version_is_not_supported

13
arch="$(epm print info -a)"
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
case "$arch" in
    x86_64)
        file="vhusbdx86_64"
        ;;
    x86)
        file="vhusbdi386"
        ;;
    armhf)
        file="vhusbdarm"
        ;;
    mips)
        file="vhusbdmips"
        ;;
    mipsel)
        file="vhusbdmipsel"
        ;;
    aarch64)
        file="vhusbdarm64"
        ;;
    *)
        fatal "$arch arch is not supported"
        ;;
esac

38 39
# https://www.virtualhere.com/sites/default/files/usbserver/vhusbdx86_64
PKGURL="https://www.virtualhere.com/sites/default/files/usbserver/$file"
40

41 42 43
# FIXME
VERSION="*"
if [ "$VERSION" = "*" ] ; then
44
    VERSION="$(eget -O- https://virtualhere.com/usb_server_software | grep "<strong>Version" | sed -e 's|.*<strong>Version ||' -e 's|</strong>.*||')"
45 46 47
    [ -n "$VERSION" ] || fatal "Can't get version for $PKGNAME"
fi

48
install_pack_pkgurl $VERSION
49 50 51 52 53 54

echo
echo "Note: run
# serv $PKGNAME on
to enable and start $PKGNAME system service
"