diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-07-25 02:13:11 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-07-25 02:26:05 +0300 |
commit | e30271f96f5c162b5c32ec41aa7987ae66bce62c (patch) | |
tree | aeb6d999e9f98d82e90c80e461f5a9b80066e6c8 | |
parent | 2fb7225d28cbac6d124533eb0cbc5ada0ccb731f (diff) |
armbian: fix distro check
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r-- | etc/library.sh | 7 | ||||
-rw-r--r-- | etc/ncp.cfg | 6 | ||||
-rw-r--r-- | ncp.sh | 2 | ||||
-rwxr-xr-x | update.sh | 2 | ||||
-rw-r--r-- | updates/1.16.0.sh | 3 |
5 files changed, 7 insertions, 13 deletions
diff --git a/etc/library.sh b/etc/library.sh index 3ddd4c7f..b6a13c69 100644 --- a/etc/library.sh +++ b/etc/library.sh @@ -273,11 +273,8 @@ function is_more_recent_than() function check_distro() { local cfg="${1:-$NCPCFG}" - local len="$(jq '.release_issue | length' < "$cfg")" - for i in $(seq 0 $((len-1))); do - local supported=$(jq -r .release_issue[$i] < "$cfg") - grep -q "$supported" /etc/issue && return 0 - done + local supported=$(jq -r .release < "$cfg") + grep -q "$supported" <(lsb_release -sc) && return 0 return 1 } diff --git a/etc/ncp.cfg b/etc/ncp.cfg index 5adf74ae..c72d92c8 100644 --- a/etc/ncp.cfg +++ b/etc/ncp.cfg @@ -1,9 +1,5 @@ { "nextcloud_version": "16.0.3", "php_version": "7.3", - "release": "buster", - "release_issue": [ - "Debian GNU/Linux 10", - "Raspbian GNU/Linux 10" - ] + "release": "buster" } @@ -22,7 +22,7 @@ install() { # NCP-CONFIG apt-get update - $APTINSTALL git dialog whiptail jq file + $APTINSTALL git dialog whiptail jq file lsb-release mkdir -p "$CONFDIR" "$BINDIR" # include option in raspi-config (only Raspbian) @@ -165,12 +165,10 @@ is_active_app nc-autoupdate-nc && run_app nc-autoupdate-nc check_distro "$NCPCFG" && check_distro etc/ncp.cfg || { php_ver_new=$(jq -r '.php_version' < etc/ncp.cfg) release_new=$(jq -r '.release' < etc/ncp.cfg) - issue_new=$( jq -r '.release_issue' < etc/ncp.cfg) cfg="$(jq '.' "$NCPCFG")" cfg="$(jq '.php_version = "'$php_ver_new'"' <<<"$cfg")" cfg="$(jq '.release = "'$release_new'"' <<<"$cfg")" - cfg="$(jq '.release_issue = '"$issue_new" <<<"$cfg")" echo "$cfg" > /usr/local/etc/ncp-recommended.cfg [[ -f /.dockerenv ]] && \ diff --git a/updates/1.16.0.sh b/updates/1.16.0.sh index 9ec1ffe2..0748c2df 100644 --- a/updates/1.16.0.sh +++ b/updates/1.16.0.sh @@ -12,6 +12,9 @@ source /usr/local/etc/library.sh apt-get update apt-get install -y --no-install-recommends php-smbclient exfat-fuse exfat-utils +# install lsb-release +apt-get install -y --no-install-recommends lsb-release + # docker images only [[ -f /.docker-image ]] && { : |