diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-03-13 09:24:34 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-03-13 09:24:34 +0300 |
commit | d7bbe2516e2f39b4fa72276cc80a1f26daaebaa8 (patch) | |
tree | 7c1517c49b5fe24bf729c505d67d84594e8f1184 | |
parent | e03b0953258716799ac25f3e293db823a69f7d0d (diff) |
nc-scan: improvementsv1.9.8
-rw-r--r-- | bin/ncp/TOOLS/nc-scan.sh | 19 | ||||
-rw-r--r-- | etc/ncp-config.d/nc-scan.cfg | 35 |
2 files changed, 48 insertions, 6 deletions
diff --git a/bin/ncp/TOOLS/nc-scan.sh b/bin/ncp/TOOLS/nc-scan.sh index b8b40507..394bb53c 100644 --- a/bin/ncp/TOOLS/nc-scan.sh +++ b/bin/ncp/TOOLS/nc-scan.sh @@ -11,17 +11,28 @@ install() { - cat > /usr/local/bin/ncp-scan <<EOF + cat > /usr/local/bin/ncp-scan <<'EOF' #!/bin/bash -cd /var/www/nextcloud -sudo -u www-data php occ files:scan --all +ncc files:scan -n -v --all EOF chmod +x /usr/local/bin/ncp-scan } configure() { - /usr/local/bin/ncp-scan + [[ "$RECURSIVE" == no ]] && local recursive=--shallow + [[ "$NONEXTERNAL" == yes ]] && local non_external=--home-only + + [[ "$PATH1" != "" ]] && \ + ncc files:scan -n -v $recursive $non_external -p "$PATH1" + + [[ "$PATH2" != "" ]] && \ + ncc files:scan -n -v $recursive $non_external -p "$PATH2" + + [[ "$PATH3" != "" ]] && \ + ncc files:scan -n -v $recursive $non_external -p "$PATH3" + + [[ "${PATH1}${PATH2}${PATH3}" == "" ]] && ncc files:scan -n -v --all } # License diff --git a/etc/ncp-config.d/nc-scan.cfg b/etc/ncp-config.d/nc-scan.cfg index edc3f88e..3c1f23f3 100644 --- a/etc/ncp-config.d/nc-scan.cfg +++ b/etc/ncp-config.d/nc-scan.cfg @@ -3,7 +3,38 @@ "name": "Nc-scan", "title": "nc-scan", "description": "Scan NC for externally modified files", - "info": "", + "info": "Optionally we can specify up to 3 paths in the form '_user_/files/_path_'", "infotitle": "", - "params": [] + "params": [ + { + "id": "RECURSIVE", + "name": "Recursive", + "value": "yes", + "type": "bool" + }, + { + "id": "NONEXTERNAL", + "name": "Ignore external files", + "value": "no", + "type": "bool" + }, + { + "id": "PATH1", + "name": "Path", + "value": "", + "suggest": "/ncp/files/Documents" + }, + { + "id": "PATH2", + "name": "Path", + "value": "", + "suggest": "/family/files/Photos" + }, + { + "id": "PATH3", + "name": "Path", + "value": "", + "suggest": "/family/files/Videos" + } + ] } |