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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
PKGNAME=zerotier-one
SUPPORTEDARCHES="x86_64 aarch64 ppc64el"
VERSION="$2"
DESCRIPTION="ZeroTier - A Smart Ethernet Switch for Earth from the official site"
URL="https://zerotier.com"
. $(dirname $0)/common.sh
pkg="$(epm print info -p)"
arch="$(epm print info -a)"
[ "$pkg" = "deb" ] && arch="$(epm print info --distro-arch)"
distr="$(epm print info -s)"
repo="$(epm print info -r)"
case "$distr" in
alt)
distr=redhat
if [ "$repo" = "p9" ] || [ "$repo" = "c9f2" ] ; then
repo=el6
else
repo=el8
fi
;;
centos|rhel)
distr=redhat
repo=fc$repo
;;
debian|ubuntu)
distr=debian
;;
fedora)
distr=redhat
repo=fc$repo
;;
*)
;;
esac
dv=$distr/$repo
if [ "$VERSION" = "*" ] ; then
# hack with --compressed due broken answer from the server
RELEASEURL=$(eget --compressed --list --latest https://download.zerotier.com/RELEASES/*) || fatal
VERSION="$(basename $RELEASEURL)"
fi
# hack with --compressed due broken answer from the server
PKGURL="$(eget --compressed --list --latest https://download.zerotier.com/RELEASES/$VERSION/dist/$dv/${PKGNAME}[-_]$VERSION*$arch.$pkg)"
# TODO: install_pkgurl
epm install --scripts "$PKGURL"