Obfuscate RCS ID matching so that CVS doesn't expand it.
[netbsd-mini2440.git] / share / examples / apm / script
blobe4c35c530872f077b97af180f8a880867c3c648a
1 #!/bin/sh
3 # $NetBSD: script,v 1.4 2000/11/05 03:30:51 lukem Exp $
7 # Link this script to /etc/apm/{suspend,standby,resume,line,battery}
8 # to play some sounds on suspend/resume, and enable/shutdown the
9 # network card:
11 # mkdir /etc/apm
12 # cp script /etc/apm/suspend
13 # cd /etc/apm
14 # for i in standby resume line battery ; do ln suspend $i ; done
15 # chmod a+x suspend standby resume line battery
17 # See apmd(8) for more information.
21 PATH=/usr/pkg/bin:/sbin:$PATH
22 export PATH
24 # Where some sound files are stored:
25 S=/usr/X11R6/share/kde/sounds
27 # What my network card's recognized as:
28 if=ne0
30 LOGGER='logger -t apm'
33 noise() {
34 if [ -f $1 ]; then
35 audioplay -q -f -s 22050 -c 1 $1
39 case $0 in
40 *suspend)
41 $LOGGER 'Suspending...'
42 noise $S/KDE_Window_UnMaximize.wav
43 # In case some NFS mounts still exist - we don't want them to hang:
44 umount -a -t nfs
45 umount -a -f -t nfs
46 ifconfig $if down
47 sh /etc/rc.d/dhclient stop
48 $LOGGER 'Suspending done.'
51 *standby)
52 $LOGGER 'Going to standby mode ....'
53 noise $S/KDE_Window_UnMaximize.wav
54 # In case some NFS mounts still exist - we don't want them to hang:
55 umount -a -t nfs
56 umount -a -f -t nfs
57 ifconfig $if down
58 sh /etc/rc.d/dhclient stop
59 $LOGGER 'Standby done.'
62 *resume)
63 $LOGGER 'Resuming...'
64 noise $S/KDE_Startup.wav
65 sh /etc/rc.d/dhclient start
66 # mount /home
67 # mount /data
68 $LOGGER 'Resuming done.'
71 *line)
72 # noise $S/KDE_Window_DeIconify.wav
73 $LOGGER 'Running on power line.'
74 mount -u -o atime,devmtime -A -t ffs
75 atactl wd0 setidle 0
78 *battery)
79 # noise $S/KDE_Window_DeIconify.wav
80 $LOGGER 'Running on battery.'
81 mount -u -o noatime,nodevmtime -A -t ffs
82 atactl wd0 setidle 5
85 esac
87 exit 0