#!/bin/sh ############################ ## Author: mirza ## ## /etc/scripts/standby ## ## ## ## TestEnvironment: ## ## - IBM X31 ## ## - X-driver=VESA ## ## - kernel 2.6.5 ## ############################ ############################ ## start SUSPEND TO RAM ## ############################ # change to VT1 chvt 1 # Unmount any NFS or SMB filesystems: umount -a -r -t nfs,smbfs # bluetooth off hciconfig hci0 down # remove modules rmmod ipw2100 ## WLAN rmmod psmouse ## mouse rmmod ehci-hcd ## USB module rmmod uhci-hcd ## -||- rmmod ohci-hcd ## -||- # update the disk super block sync # wait a second sleep 1 # turn the LCD off radeontool light off # suspend to ram echo -n mem > /sys/power/state ############################ ## resume from SUSPEND ## ############################ # wait 2 seconds to avoid double # or longe pressing of power button sleep 2 # set system time to hardware clock hwclock --hctosys # load modules modprobe psmouse # mouse module # don't load ipw2100. I'll load # it manually if I need it # modprobe ipw2100 # WLAN module # turn the LCD on radeontool light on # go back to VT7 (X) chvt 7 # /tmp/standby_state file will be created to be able # to avoid catching "LOCK" state by lightwatch.pl # see lightwatch.pl for details. if /tmp/standby_state # exists, lightwatch.pl will not react on this command touch /tmp/standby_state xscreensaver-command -lock 2> /dev/null 1> /dev/null rm /tmp/standby_state # start laptop mode if ac-adapter was # plugged out during the suspend mode # although linux should also do this # during standby mode . /etc/acpi/acpi_handler.sh battery BAT0 2> /dev/null 1> /dev/null ########### END ###########