Update share_fix.sh layout
This commit is contained in:
parent
f7a8e52123
commit
af715bf3a1
1 changed files with 28 additions and 10 deletions
28
share_fix.sh
28
share_fix.sh
|
@ -1,9 +1,27 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
(
|
# share fix
|
||||||
volume="data"
|
# use this script to rebuild default configs for shares if the ._share becomes
|
||||||
#volume=$(rn_nml -g volumes | grep resource-id | awk '{print $2}' | sed 's/resource-id="//;s/"$//')
|
# broken for whatever reason.
|
||||||
|
|
||||||
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
|
echo "Activating Share rebuilder"
|
||||||
|
|
||||||
|
volume="data"
|
||||||
|
echo "Querying readynasd for list of volumes..."
|
||||||
|
x=$(rn_nml -g volumes | grep "resource-id" | sed 's/^.*id="//;s/".*//;')
|
||||||
|
number=$(echo $x | wc -w)
|
||||||
|
echo "$number volume(s) found."
|
||||||
|
for volume in $x
|
||||||
|
do
|
||||||
|
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]
|
[$i]
|
||||||
available = 1
|
available = 1
|
||||||
path = /$volume/$i
|
path = /$volume/$i
|
||||||
|
@ -42,4 +60,4 @@ cat > samba.conf << EOF
|
||||||
EOF
|
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
|
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
|
done
|
||||||
)
|
done
|
Loading…
Add table
Add a link
Reference in a new issue