Fix for sure this time though!
This commit is contained in:
parent
34b09d338b
commit
4838c5725e
1 changed files with 23 additions and 24 deletions
|
@ -141,31 +141,30 @@ else
|
||||||
for volume in $x; do
|
for volume in $x; do
|
||||||
echo "= Investigating volume /$volume..."
|
echo "= Investigating volume /$volume..."
|
||||||
objects=$(cd /"$volume"; ls -dA */ 2>/dev/null | egrep -v "^.apps\/$|^home\/$|^.purge\/$|^._share\/$|^.timemachine\/$|^.vault\/$|^.TemporaryItems\/$" | sed 's/\/$//')
|
objects=$(cd /"$volume"; ls -dA */ 2>/dev/null | egrep -v "^.apps\/$|^home\/$|^.purge\/$|^._share\/$|^.timemachine\/$|^.vault\/$|^.TemporaryItems\/$" | sed 's/\/$//')
|
||||||
if [[ $? == 2 ]]; then
|
if [[ $? == 2 ]]; then
|
||||||
echo "No shares or LUNs found."
|
echo "No shares or LUNs found."
|
||||||
else
|
else
|
||||||
echo "= Objects found:" $objects
|
echo "= Objects found:" $objects
|
||||||
backup_configs
|
backup_configs
|
||||||
for item in $objects; do
|
for item in $objects; do
|
||||||
echo "== Reviewing $item"
|
echo "== Reviewing $item"
|
||||||
if ls -QdA /"$volume"/"$item"/.iscsi >/dev/null 2>&1; then
|
if ls -QdA /"$volume"/"$item"/.iscsi >/dev/null 2>&1; then
|
||||||
iscsi_create
|
iscsi_create
|
||||||
else
|
else
|
||||||
share_create
|
share_create
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
echo "= done with /$volume"
|
echo "= done with /$volume"
|
||||||
fi
|
if [[ $found -gt 0 ]] && [[ $readynasd ]] ; then
|
||||||
|
echo "*** Restarting readynasd to finish changes... ***"
|
||||||
if [[ $found -gt 0 ]] && [[ $readynasd ]] ; then
|
systemctl restart readynasd
|
||||||
echo "*** Restarting readynasd to finish changes... ***"
|
else
|
||||||
systemctl restart readynasd
|
echo "Not starting readynasd because it returned a bad message earlier; restart manually."
|
||||||
else
|
fi
|
||||||
echo "Not starting readynasd because it returned a bad message earlier; restart manually."
|
done
|
||||||
fi
|
|
||||||
|
|
||||||
echo "================================================="
|
echo "================================================="
|
||||||
echo "| Completed share creation! We were able to |"
|
echo "| Completed share creation! We were able to |"
|
||||||
echo "| rebuild $shares shares and $iscsi LUNs. |"
|
echo "| rebuild $shares shares and $iscsi LUNs. |"
|
||||||
echo "================================================="
|
echo "================================================="
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue