#!/bin/sh
# -*- Mode: shell-script -*-
# Copyright (C) 2003 by MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
# Redistribution of this file is permitted under the terms of the GNU 
# Public License (GPL)

debug=

. /etc/sysconfig/suspend

[ -n "$debug" ] && debug="-d"

while getopts d opt
  do
  case "$opt" in
      d) debug="-d";;
  esac
done
shift $((OPTIND - 1))

if [[ -e /proc/acpi/sleep || -n $SWSUSP_FORCE_SUSPEND_MODE ]];then
    /etc/sysconfig/suspend-scripts/suspend.control $debug acpi $@
elif [[ -e /proc/apm ]];then
    if [[ -z $@ ]];then
	apm -s
    else
	/etc/sysconfig/suspend-scripts/suspend.control $debug apm $@
    fi
fi
