home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 15 / hacker15 / 15_H4CK3R#15.ISO / linux_security / engarde / ENGARDE_COMMUNITY_FEINT.ISO / bin / reboot < prev    next >
Encoding:
Text File  |  2002-05-30  |  861 b   |  38 lines

  1. #!/bin/sh
  2.  
  3. echo "Unmounting all filesystems in /mnt (except LNX)..."
  4.  
  5. problems="NONE"
  6.  
  7. for drive in /mnt/*
  8.  do
  9.    if [ $drive != /mnt/cdrom -a $drive != /mnt/cdrom-real ]
  10.     then
  11.      if umount $drive >/dev/null 2>/dev/null
  12.       then
  13.        echo "$drive successfully unmounted."
  14.        rmdir $drive
  15.       else
  16.        if grep "$drive" /etc/mtab >/dev/null 2>/dev/null
  17.         then
  18.          echo "$drive still needs to be unmounted, please close all"
  19.          echo "programs referencing any files and close or  'cd /'"
  20.          echo "shells, then re-run this program"
  21.          problems="SOME"
  22.        fi
  23.      fi
  24.    fi
  25.  done
  26.  
  27. if [ $problems == "NONE" ]
  28.  then
  29.    echo Rebooting...
  30.    sync
  31.    sleep 2
  32.    # Use special standalone reboot program "bounce" to do a hard reboot
  33.    bounce me harder
  34.  else
  35.    echo
  36.    echo "run $0 again after addressing above problems"
  37. fi
  38.