#!/bin/bash # Script to prepare VAIO FX405 for software suspend with some extra features # (c) 2002 Markus Gaugusch - http://gaugusch.at/vaio/ # You can re-distribute and change this screept freely! # # Written for usage with SuSE linux # check for running xmms (user "markus") and stop it if [ "`ps uax | grep xmms | grep -v grep`" ] ; then su markus -c "export DISPLAY=:0.0 ; export TMPDIR=/home/markus/tmp; xmms -s" fi # # GPM kills X on restart /etc/rc.d/init.d/gpm stop # eject pcmcia cards - I had problems here /sbin/cardctl eject # remove soft-modem drivers - they reset the machine if used after suspend!! rmmod hsfserial hsfengine hsfvia hsfosspec >/dev/null 2>&1 # stop hotplugging service - it blocks usbcore which has to be removed! rchotplug stop # stop sound daemon - sound drivers don't survive suspend as well killall esd rmmod usb-uhci usbmouse hid usbcore # last resort for esound killall -9 esd rcalsasound stop # sync clock to cmos hwclock --systohc --utc # acpid takes 100% cpu after resume, so we stop it here killall acpid # suspend the machine ( 1 1 0 = reboot after suspend, 1 0 0 = power off) echo -n "1 0 0" > /proc/sys/kernel/swsusp sleep 5 # give time to sleep rcalsasound start # restart esd for user markus #su markus -c "esd -nobeeps &" #usb modules modprobe usb-uhci modprobe usbmouse modprobe hid # restart hotplug service rchotplug start # renew dhcp ip #dhcpcd -n # restore clock hwclock --hctosys --utc # and restart acpid acpid