Fix for sure this time though!

This commit is contained in:
Cody Cook 2017-12-07 22:18:20 -08:00
commit 4838c5725e

View file

@ -141,31 +141,30 @@ else
for volume in $x; do
echo "= Investigating volume /$volume..."
objects=$(cd /"$volume"; ls -dA */ 2>/dev/null | egrep -v "^.apps\/$|^home\/$|^.purge\/$|^._share\/$|^.timemachine\/$|^.vault\/$|^.TemporaryItems\/$" | sed 's/\/$//')
if [[ $? == 2 ]]; then
echo "No shares or LUNs found."
else
echo "= Objects found:" $objects
backup_configs
for item in $objects; do
echo "== Reviewing $item"
if ls -QdA /"$volume"/"$item"/.iscsi >/dev/null 2>&1; then
iscsi_create
else
share_create
fi
done
fi
echo "= done with /$volume"
fi
if [[ $found -gt 0 ]] && [[ $readynasd ]] ; then
echo "*** Restarting readynasd to finish changes... ***"
systemctl restart readynasd
else
echo "Not starting readynasd because it returned a bad message earlier; restart manually."
fi
if [[ $? == 2 ]]; then
echo "No shares or LUNs found."
else
echo "= Objects found:" $objects
backup_configs
for item in $objects; do
echo "== Reviewing $item"
if ls -QdA /"$volume"/"$item"/.iscsi >/dev/null 2>&1; then
iscsi_create
else
share_create
fi
done
fi
echo "= done with /$volume"
if [[ $found -gt 0 ]] && [[ $readynasd ]] ; then
echo "*** Restarting readynasd to finish changes... ***"
systemctl restart readynasd
else
echo "Not starting readynasd because it returned a bad message earlier; restart manually."
fi
done
echo "================================================="
echo "| Completed share creation! We were able to |"
echo "| rebuild $shares shares and $iscsi LUNs. |"
echo "================================================="
fi