#!/bin/bash

# name        : pmac_g3
# author      : Stephan Leemburg <@>
# modified    :	Matthias Grimm <joker@cymes.de>
# description : hardware related stuff for G3 Powerbooks
# requirements: wakebay from pmud-utils package
# limitations : not needed for G3 Pismo
#
# --- end of public part -- don't change below this line ---

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

# source configuration
. config

case "$1" in
  powersave)
    ;;
  custom)
    ;;
  performance)
    ;;
  sleep)
    ;;
  wakeup)
    [ -f /proc/sys/dev/cdrom/info ] && {
      device=$(cat /proc/sys/dev/cdrom/info | (
      IFS=":"
      while read var val
      do
        [ "$var" = "drive name" ] && {
	  echo $val
	  break
	}
      done
      ))
      [ ! -z "$device" ] && {
        wakebay /dev/${device}
      }
    }
    ;;
esac

exit 0
