#!/bin/bash

# $1 = 'profile', 'sleep' or 'wakeup'
# $2 = 'ac' or 'battery'

case "$1" in
  profile)
  ;;
  sleep)
    KVER=`uname -r`
    case "$KVER" in
      2.2.*|2.3.*|2.4.[1-7]|2.4.[1-7]-*)
	echo "Kernel does not support sleep, shutting down!" | /usr/bin/wall
	/sbin/shutdown -h now
      ;;
      *)
      ;;
    esac
  ;;
  wakeup)
  ;;
esac
exit 0
