为了解决合上本子待机的问题,不小心把sleep.sh删了。谁有办法帮我贴一个

声卡/显卡/打印机/USB设备等硬件问题(网卡问题请发上面的网卡板块)
回复
feirenwang
帖子: 16
注册时间: 2006-02-23 20:22
送出感谢: 0
接收感谢: 0

为了解决合上本子待机的问题,不小心把sleep.sh删了。谁有办法帮我贴一个

#1

帖子 feirenwang » 2006-02-28 20:37

/etc/acpi/sleep.sh
amino
帖子: 14
注册时间: 2005-07-24 5:00
送出感谢: 0
接收感谢: 0

#2

帖子 amino » 2006-03-01 10:25

内容如下:

#!/bin/bash

. /etc/default/acpi-support
. /usr/share/acpi-support/power-funcs
. /usr/share/acpi-support/device-funcs

DeviceConfig;

if [ x$ACPI_SLEEP != xtrue ] && [ x$1 != xforce ]; then
exit;
fi

# If PowerManager is running, let it handle policy
if [ "`pidof PowerManager`" ] && [ x$1 != xforce ] && [ x$1 != xsleep ]; then
exit;
fi

if [ x$LOCK_SCREEN = xtrue ]; then
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
. /usr/share/acpi-support/screenblank
fi
done
fi

# Generic preparation code
. /etc/acpi/prepare.sh

if [ x$RADEON_LIGHT = xtrue ]; then
# Some Radeons are a bit funny
[ -x /usr/sbin/radeontool ] && radeontool light off
fi

if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then
hdparm -d 0 /dev/hda
fi

echo -n $ACPI_SLEEP_MODE >/sys/power/state

if [ x$RESET_DRIVE = xtrue ] && [ -b /dev/hda ]; then
hdparm -w /dev/hda
hdparm -C /dev/hda
hdparm -C /dev/hda
hdparm -C /dev/hda
hdparm -d 1 /dev/hda
fi

if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then
hdparm -d 1 /dev/hda
fi

# Generic wakeup code
. /etc/acpi/resume.sh
feirenwang
帖子: 16
注册时间: 2006-02-23 20:22
送出感谢: 0
接收感谢: 0

#3

帖子 feirenwang » 2006-03-01 21:28

谢谢楼上的兄弟。想多问一句:是不是不同机器的sleep.sh都一样呢??
回复

回到 “常用硬件支持”