commit 287f902da6b54491350cb35ab1aa4138aeff85bb Author: Cody Cook Date: Tue Aug 22 15:42:12 2017 -0700 Add new file diff --git a/share_fix.sh b/share_fix.sh new file mode 100644 index 0000000..0eb8cd1 --- /dev/null +++ b/share_fix.sh @@ -0,0 +1,73 @@ +share_fix.sh +DETAILS +ACTIVITY +share_fix.sh +Sharing Info +Not shared +General Info +Type +Text +Size +2 KB (1,541 bytes) +Storage used +2 KB (1,541 bytes) +Location +t430 +Owner +me +Modified +Jul 20, 2016 by me +Opened +3:41 PM by me +Created +Mar 8, 2016 +Description +Add a description +Download permissions +Viewers can download + +#!/bin/bash +( +volume="data" +#volume=$(rn_nml -g volumes | grep resource-id | awk '{print $2}' | sed 's/resource-id="//;s/"$//') + +for i in `find /$volume/ -mindepth 2 -maxdepth 2 -type d | egrep -v "\/$volume\/home|\/$volume\/.apps|\/$volume\/.vault|\/$volume\/.purge|\/$volume\/._share|\/$volume\/.timemachine|\/$volume\/.TemporaryItems|.iscsi" | sed "s/\/$volume\///g;s/\/.*//g" | sort | uniq`; do mkdir -p /$volume/._share/${i}; cd /$volume/._share/${i}; echo "share" > datasettype.conf; echo "0,25000" > recycle.conf; echo "#dashboard:available=0 \"/$volume/$i\" 127.0.0.1(ro,insecure,insecure_locks,root_squash,anongid=99,anonuid=99,no_subtree_check,sync)" > nfs.conf; echo "" > snapdir.conf; echo "0 0 0 * * * 0" > snapshot.conf; cat > afp.conf << EOF +[$i] + available = 1 + path = /$volume/$i + invalid users = "guest","nobody","@guest","@nogroup" + admin group = admin +EOF +cat > fs.conf << EOF +compression = 0 +bitrotprotection = 0 +refquota = 0 +EOF +cat > ftp.conf << EOF +available 0 +default_access writeable +mask +fmask +dmask +user_rw +group_rw +host_rw +user_ro +group_ro +host_ro +EOF +cat > samba.conf << EOF +[$i] + path = /$volume/$i + comment = "$i folder" + force create mode = 0666 + create mask = 0666 + force directory mode = 1777 + directory mask = 1777 + admin users = "+admin","Administrator" + writeable = 1 + follow symlinks = 1 +EOF +chown root.root datasettype.conf recycle.conf snapdir.conf snapshot.conf; chown admin.admin afp.conf fs.conf ftp.conf nfs.conf samba.conf +done +) \ No newline at end of file