Share fixes
This commit is contained in:
parent
a8d460733d
commit
53f08be2b1
1 changed files with 6 additions and 5 deletions
11
share_fix.sh
11
share_fix.sh
|
@ -11,7 +11,7 @@ echo "$number volume(s) found."
|
|||
for volume in $x
|
||||
do
|
||||
echo -n "Investigating volume /$volume..."
|
||||
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`
|
||||
for i in `find /$volume/ -mindepth 1 -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
|
||||
found=1
|
||||
path="/$volume/._share/${i}"
|
||||
|
@ -45,12 +45,12 @@ EOF
|
|||
........................
|
||||
........................
|
||||
EOF
|
||||
cat > fs.conf << EOF
|
||||
cat > $path/fs.conf << EOF
|
||||
compression = 0
|
||||
bitrotprotection = 0
|
||||
refquota = 0
|
||||
EOF
|
||||
cat > ftp.conf << EOF
|
||||
cat > $path/ftp.conf << EOF
|
||||
available 0
|
||||
default_access disabled
|
||||
mask
|
||||
|
@ -63,7 +63,7 @@ user_ro
|
|||
group_ro
|
||||
host_ro
|
||||
EOF
|
||||
cat > samba.conf << EOF
|
||||
cat > $path/samba.conf << EOF
|
||||
[$i]
|
||||
path = /$volume/$i
|
||||
comment = "$i folder"
|
||||
|
@ -74,6 +74,7 @@ EOF
|
|||
follow symlinks = 1
|
||||
EOF
|
||||
echo -n "Fixing permissions on files..."
|
||||
cd $path
|
||||
chown root.root datasettype.conf recycle.conf snapdir.conf snapshot.conf
|
||||
chown admin.admin afp.conf fs.conf ftp.conf nfs.conf samba.conf custom_snapshot_management.conf custom_snapshot_schedule.conf
|
||||
echo " done!"
|
||||
|
@ -85,4 +86,4 @@ if [[ $found ]]
|
|||
then
|
||||
echo "Restarting readynasd to finish changes..."
|
||||
systemctl restart readynasd
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue