home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- echo "Unmounting all filesystems in /mnt (except LNX)..."
-
- problems="NONE"
-
- for drive in /mnt/*
- do
- if [ $drive != /mnt/cdrom -a $drive != /mnt/cdrom-real ]
- then
- if umount $drive >/dev/null 2>/dev/null
- then
- echo "$drive successfully unmounted."
- rmdir $drive
- else
- if grep "$drive" /etc/mtab >/dev/null 2>/dev/null
- then
- echo "$drive still needs to be unmounted, please close all"
- echo "programs referencing any files and close or 'cd /'"
- echo "shells, then re-run this program"
- problems="SOME"
- fi
- fi
- fi
- done
-
- if [ $problems == "NONE" ]
- then
- echo Rebooting...
- sync
- sleep 2
- # Use special standalone reboot program "bounce" to do a hard reboot
- bounce me harder
- else
- echo
- echo "run $0 again after addressing above problems"
- fi
-