Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/share/examples/apm Pull up revision 1.4 (requested by h...



details:   https://anonhg.NetBSD.org/src/rev/a9d90c8087b7
branches:  netbsd-1-5
changeset: 491631:a9d90c8087b7
user:      he <he%NetBSD.org@localhost>
date:      Sun May 06 14:30:24 2001 +0000

description:
Pull up revision 1.4 (requested by hubertf):
  Fix some errors, and provide more flexible logging.

diffstat:

 share/examples/apm/script |  28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diffs (81 lines):

diff -r 472ba4e26b96 -r a9d90c8087b7 share/examples/apm/script
--- a/share/examples/apm/script Sun May 06 14:06:18 2001 +0000
+++ b/share/examples/apm/script Sun May 06 14:30:24 2001 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: script,v 1.3 2000/06/18 16:16:34 hubertf Exp $
+# $NetBSD: script,v 1.3.2.1 2001/05/06 14:30:24 he Exp $
 #
 
 #
@@ -26,54 +26,58 @@
 # What my network card's recognized as:
 if=ne0
 
+LOGGER='logger -t apm'
+
 
 noise() {
-       audioplay -q -f -s 22050 -c 1 $1
+       if [ -f $1 ]; then
+               audioplay -q -f -s 22050 -c 1 $1
+       fi
 }
 
 case $0 in
 *suspend)      
-       logger 'Suspending...'
+       $LOGGER 'Suspending...'
        noise $S/KDE_Window_UnMaximize.wav
        # In case some NFS mounts still exist - we don't want them to hang:
        umount -a    -t nfs
        umount -a -f -t nfs
        ifconfig $if down
        sh /etc/rc.d/dhclient stop
-       logger 'Suspending done.'
+       $LOGGER 'Suspending done.'
        ;;
 
 *standby)
-       logger 'Going to standby mode ....'
+       $LOGGER 'Going to standby mode ....'
        noise $S/KDE_Window_UnMaximize.wav
        # In case some NFS mounts still exist - we don't want them to hang:
        umount -a    -t nfs
        umount -a -f -t nfs
        ifconfig $if down
        sh /etc/rc.d/dhclient stop
-       logger 'Standby done.'
+       $LOGGER 'Standby done.'
        ;;
 
 *resume)
-       logger Resuming...
+       $LOGGER 'Resuming...'
        noise $S/KDE_Startup.wav
        sh /etc/rc.d/dhclient start
        # mount /home
        # mount /data
-       logger 'Resuming done.'
+       $LOGGER 'Resuming done.'
        ;;
 
 *line)
-       # Running on power line, not battery...
        # noise $S/KDE_Window_DeIconify.wav
-       mount -u -o atime,devmtime -a
+       $LOGGER 'Running on power line.'
+       mount -u -o atime,devmtime -A -t ffs
        atactl wd0 setidle 0
        ;;
 
 *battery)
-       # Running on battery...
        # noise $S/KDE_Window_DeIconify.wav
-       mount -u -o noatime,nodevmtime -a
+       $LOGGER 'Running on battery.'
+       mount -u -o noatime,nodevmtime -A -t ffs
        atactl wd0 setidle 5
        ;;
 



Home | Main Index | Thread Index | Old Index