mirror of https://github.com/dnomd343/kms-server
Dnomd343
3 years ago
2 changed files with 12 additions and 59 deletions
@ -1,54 +1,8 @@ |
|||
get_github_latest_version() { |
|||
VERSION=$(curl --silent "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'); |
|||
} |
|||
|
|||
get_architecture() { |
|||
case "$(uname -m)" in |
|||
'i386' | 'i686') |
|||
MACHINE='i386' |
|||
;; |
|||
'amd64' | 'x86_64') |
|||
MACHINE='amd64' |
|||
;; |
|||
'armv7' | 'armv7l') |
|||
MACHINE='arm' |
|||
;; |
|||
'armv8' | 'aarch64') |
|||
MACHINE='arm64' |
|||
;; |
|||
*) |
|||
echo "The architecture is not supported." |
|||
exit 1 |
|||
;; |
|||
esac |
|||
} |
|||
|
|||
VLMCSD_DIR="/tmp/vlmcsd" |
|||
PKG_DIR="$VLMCSD_DIR/pkg" |
|||
mkdir -p $PKG_DIR |
|||
|
|||
get_architecture |
|||
case "$MACHINE" in |
|||
'i386') |
|||
VLMCSD_PATH="binaries/Linux/intel/static/vlmcsd-x86-musl-static" |
|||
;; |
|||
'amd64') |
|||
VLMCSD_PATH="binaries/Linux/intel/static/vlmcsd-x64-musl-static" |
|||
;; |
|||
'arm') |
|||
VLMCSD_PATH="binaries/Linux/arm/little-endian/static/vlmcsd-armv7el-uclibc-static" |
|||
;; |
|||
'arm64') |
|||
VLMCSD_PATH="binaries/Linux/arm/little-endian/static/vlmcsd-armv7el-uclibc-static" |
|||
;; |
|||
*) |
|||
exit 1 |
|||
;; |
|||
esac |
|||
|
|||
get_github_latest_version "Wind4/vlmcsd" |
|||
wget -P $PKG_DIR "https://github.com/Wind4/vlmcsd/releases/download/$VERSION/binaries.tar.gz" |
|||
tar xf $PKG_DIR/binaries.tar.gz -C $PKG_DIR |
|||
mv $PKG_DIR/$VLMCSD_PATH $VLMCSD_DIR/vlmcsd |
|||
|
|||
rm -rf $PKG_DIR |
|||
apk add --no-cache git make build-base |
|||
git clone --branch master --single-branch https://github.com/Wind4/vlmcsd.git /tmp/vlmcsd-build |
|||
cd /tmp/vlmcsd-build |
|||
make |
|||
mkdir /tmp/vlmcsd |
|||
cp /tmp/vlmcsd-build/bin/vlmcsd /tmp/vlmcsd/ |
|||
cp /tmp/vlmcsd-build/etc/vlmcsd.kmd /tmp/vlmcsd/ |
|||
rm -rf /tmp/vlmcsd-build |
|||
|
Loading…
Reference in new issue