From 07056ab512d8402ea44d5235af8054b5c2d0b191 Mon Sep 17 00:00:00 2001 From: Moul Date: Tue, 11 Oct 2016 19:30:05 +0200 Subject: [PATCH] [enh] #25: release name convention have changed: - Grep 'server' as there is now a 'server' and 'desktop' versions. - Retrieve 'server' releases which doesn't contain NodeWebkit: - This reduce by two the size of the package: download & space usage. - Grep 'linux' in the case there is only a 'windows' package released: - that way windows package is not retrieved but an old version for linux. - Request only one time GitHub. grep previous variable. - Use variable for debian package path name. --- scripts/functions.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index cbdb653..49ac6d0 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -2,13 +2,14 @@ INSTALL_DUNITER_DEBIAN_PACKAGE () { # Retrieve url of last version and version number -url=$(curl -s https://api.github.com/repos/duniter/duniter/releases | grep "browser_" | grep $arch | head -1 | cut -d\" -f4) -version=$(curl -s https://api.github.com/repos/duniter/duniter/releases | grep "browser_" | grep $arch | head -1 | cut -d/ -f8) +url=$(curl -s https://api.github.com/repos/duniter/duniter/releases | grep "browser_" | grep $arch | grep "linux" | grep "server" | head -1 | cut -d\" -f4) +version=$(echo $url | cut -d/ -f8) # Retrieve debian package and install it wget -nc --quiet $url -P /tmp -sudo dpkg -i /tmp/duniter-$version-linux-$arch.deb -sudo rm -f /tmp/duniter-$version-linux-$arch.deb +deb="/tmp/duniter-server-$version-linux-$arch.deb" +sudo dpkg -i $deb +sudo rm -f $deb } CONFIG_SSOWAT_FOR_RESTRICTED_ACCESS () {