Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2019-07-02 04:15:46 +0300
committernachoparker <nacho@ownyourbits.com>2019-07-06 06:43:54 +0300
commit35526ab9fcfc538b68a10bbf449d6b1fe5ea7d6d (patch)
treebf5f7762937f0fd38bb7463041e25726cc74bd16 /etc
parent88da901eddff125b3e71d9706fbe02edffc659b3 (diff)
build: use a system wide config file. Remove sury sources
Signed-off-by: nachoparker <nacho@ownyourbits.com>
Diffstat (limited to 'etc')
-rw-r--r--etc/library.sh24
-rw-r--r--etc/ncp.cfg9
2 files changed, 33 insertions, 0 deletions
diff --git a/etc/library.sh b/etc/library.sh
index d2ec12b6..3ddd4c7f 100644
--- a/etc/library.sh
+++ b/etc/library.sh
@@ -8,8 +8,21 @@
# More at ownyourbits.com
#
+NCPCFG=${NCPCFG:-/usr/local/etc/ncp.cfg}
CFGDIR=/usr/local/etc/ncp-config.d
BINDIR=/usr/local/bin/ncp
+BINDIR=/usr/local/bin/ncp
+
+command -v jq &>/dev/null || {
+ apt-get update
+ apt-get install -y --no-install-recommends jq
+}
+
+[[ -f "$NCPCFG" ]] && {
+ NCVER=$( jq -r .nextcloud_version < "$NCPCFG")
+ PHPVER=$( jq -r .php_version < "$NCPCFG")
+ RELEASE=$(jq -r .release < "$NCPCFG")
+}
function configure_app()
{
@@ -257,6 +270,17 @@ function is_more_recent_than()
return 0
}
+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
+ return 1
+}
+
# License
#
# This script is free software; you can redistribute it and/or modify it
diff --git a/etc/ncp.cfg b/etc/ncp.cfg
new file mode 100644
index 00000000..2b721009
--- /dev/null
+++ b/etc/ncp.cfg
@@ -0,0 +1,9 @@
+{
+ "nextcloud_version": "15.0.8",
+ "php_version": "7.2",
+ "release": "stretch",
+ "release_issue": [
+ "Debian GNU/Linux 9",
+ "Raspbian GNU/Linux 9"
+ ]
+}