fi
if [ $? = 0 ]; then
- umount "/Volumes/$INSTALLERVOL"
+ if [ -e "/Volumes/$INSTALLERVOL" ]; then
+ hdiutil detach "/Volumes/$INSTALLERVOL"
+ fi
if [ -e "$DMG" ]; then
open $DMG
else
MOUNTEDAPP="/Volumes/$INSTALLERVOL/$APP.app"
echo "Waiting for '$MOUNTEDAPP' to appear"
while [ \! -e "$MOUNTEDAPP" ]; do
- if [ $(( N%1000 )) = 0 ]; then
- echo -n "."
- fi
+ echo -n "."
N=$(( N+1 ))
+ if [ $N = 40 ]; then
+ echo ""
+ echo "Looks like something wrong with the DMG '$DMG'"
+ exit 4
+ fi
+ sleep 0.1
done
echo ""
else
echo "Syncing '$MOUNTEDAPP' to '$APPLICATIONS/'"
rsync -avh "$MOUNTEDAPP" "$APPLICATIONS/"
echo "Unmounting '/Volumes/$INSTALLERVOL'"
- umount "/Volumes/$INSTALLERVOL"
+ hdiutil detach "/Volumes/$INSTALLERVOL"
fi