#! /bin/sh
#
# umountfs	Turn off  swap and unmount all file systems.
#
# Version:      @(#)umountfs  2.78  13-Nov-1999  miquels@cistron.nl
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin

case "`uname -r`" in
  1.*|2.[01].*) FORCE=""   ;;
  *)            FORCE="-f" ;;
esac

# Write a reboot record to /var/log/wtmp before unmounting
halt -w

echo -n "Deactivating swap... "
swapoff -a
echo "done."

echo -n "Unmounting file systems... "
umount $FORCE -a -r
echo "done."

mount -n -o remount,ro /

