#!/bin/bash set -x # Modules to unload/reload (do not use radeonfb!) RELOAD="psmouse mousedev acerhk" # Subsystems to stop/start RESTART="hotplug powernowd gpm" # Switch to console to reduce problems /usr/bin/chvt 1 # Stopping subsystems for S in $RESTART do /etc/init.d/$S stop done # Unloading modules for M in $RELOAD do         if /bin/grep -q "^$M[[:blank:]]" /proc/modules         then                 /sbin/modprobe -r "$M"         fi done # Zzzzz sync echo disk > /sys/power/state #sync # Reloading modules... for M in $RELOAD do         if /bin/grep -q "^$M[[:blank:]]" /proc/modules         then                 /sbin/modprobe "$M"         fi done # Restarting subsystems... for S in $RESTART do /etc/init.d/$S start done