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
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ncp/NETWORKING/samba.sh')
-rw-r--r--bin/ncp/NETWORKING/samba.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/ncp/NETWORKING/samba.sh b/bin/ncp/NETWORKING/samba.sh
index 0b781a54..c4fff3c3 100644
--- a/bin/ncp/NETWORKING/samba.sh
+++ b/bin/ncp/NETWORKING/samba.sh
@@ -68,6 +68,14 @@ EOF
done < <( ls -d "$DATADIR"/*/files )
for user in ${USERS[@]}; do
+ # Exclude users not matching group filter (if enabled)
+ if [[ -n "$FILTER_BY_GROUP" ]] \
+ && [[ -z "$(ncc user:info "$user" --output=json | jq ".groups[] | select( . == \"${FILTER_BY_GROUP}\" )")" ]]
+ then
+ echo "Omitting user $user (not in group ${FILTER_BY_GROUP})...";
+ continue;
+ fi
+
echo "adding SAMBA share for user $user"
local DIR="$DATADIR/$user/files"
[ -d "$DIR" ] || { echo -e "INFO: directory $DIR does not exist."; return 1; }
@@ -122,4 +130,3 @@ EOF
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA
-