Code: Alles auswählen
#!/bin/bash
/usr/local/bin/sleep.sh 3
Zeile 36
MODULES="ehci_hcd sg blamod blamod usw."
Code: Alles auswählen
#!/bin/bash
/usr/local/bin/sleep.sh 3
Code: Alles auswählen
#!/bin/bash
/usr/local/bin/ask &
sleep 1m && /usr/local/bin/sleep.sh 3
Code: Alles auswählen
#!/bin/bash
#\
exec wish "$0"
# ---------------------------------------------------------------------------------
global env
set global_var(titel) "ACPI - Sleep"
proc stop_sleep { } {
#eval exec /usr/bin/X11/xclock
eval exec xterm -e "killall -9 lid.sh sleep"
}
# Now, the Main-Window
frame .menuFrame -borderwidth 1 -relief raised
frame .mittlererRahmen -borderwidth 1 -relief raised
frame .controlFrame -borderwidth 1 -relief raised
pack .menuFrame -side top -fill x
pack .mittlererRahmen -side top -fill x
pack .controlFrame -side top -fill x
# Buttons (DV-Grab)
button .sleep -text "Sleep" -default active -command exit
button .bexit -text "Stop Sleep" -state active -command stop_sleep
pack .sleep -in .controlFrame -side left -fill x -expand yes
pack .bexit -in .controlFrame -side left -fill x -expand yes
# Labels, left side
label .lsource -text "Lid wurde gedrückt, bitte wählen sie wie sie weiter fortfahren wollen"
grid .lsource -in .mittlererRahmen -row 1 -column 0 -sticky sw
# Window-Settings
wm title . $global_var(titel)
wm minsize . 380 150
Code: Alles auswählen
#!/bin/bash
#===================================================================================
#
# FILE: sleep.sh
#
# USAGE: ./sleep.sh
#
# SYNOPSIS:
#
# DESCRIPTION:
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Michel Pelzer (), michel@pelzernet.de
# COMPANY: ATecoM GmbH
# VERSION: 1.0
# CREATED: 08/09/04 14:18:39 CEST
# REVISION: ---
#===================================================================================
COL="\\033[20G"
CS="\\033[1;32m"
CF="\\033[1;31m"
CW="\\033[1;33m"
CN="\\033[0;39m"
if [ $EUID -ne 0 ]; then
echo "You must be root, sorry"
exit
fi
SERVICES=""
MODULES="ehci_hcd sg"
UNLOADED=""
STATE=$1
echo
echo "-------------------------------------------------------------"
echo "ACPI: Setting System to \"Suspent to RAM\""
echo "-------------------------------------------------------------"
echo
for i in $SERVICES; do
/etc/init.d/$i stop
done
for i in $MODULES; do
if /sbin/lsmod | grep -q $i; then
UNLOADED="$UNLOADED $i"
fi
done
echo -n "Entferne Module: "
for i in $UNLOADED; do
/sbin/modprobe -r $i
if [ $? -eq 0 ]; then
echo -n -e $CS "$i "$CN
else
echo -n -e $CF "$i "$CN
fi
done
echo
sleep 2
echo $STATE > /proc/acpi/sleep
#after resume
echo -n "Lade Module: "
sleep 20 && killall -9 sleep
for i in $UNLOADED; do
modprobe $i
if [ $? -eq 0 ]; then
echo -n -e $CS "$i "$CN
else
echo -n -e $CF "$i "$CN
fi
done
for i in $SERVICES; do
/etc/init.d/$i start
done
echo
echo "-------------------------------------------------------------"
echo