Source-Changes-HG archive

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

[src/trunk]: src Add share/examples/apm/script, an example script to put into



details:   https://anonhg.NetBSD.org/src/rev/03e2929c0e50
branches:  trunk
changeset: 479984:03e2929c0e50
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Wed Dec 29 04:16:21 1999 +0000

description:
Add share/examples/apm/script, an example script to put into
/etc/apm/{line,battery,standby,...}

diffstat:

 distrib/sets/lists/base/mi |   3 +-
 distrib/sets/lists/misc/mi |   3 +-
 etc/mtree/NetBSD.dist      |   7 ++++-
 share/examples/apm/script  |  65 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+), 3 deletions(-)

diffs (124 lines):

diff -r 78186c4107a5 -r 03e2929c0e50 distrib/sets/lists/base/mi
--- a/distrib/sets/lists/base/mi        Wed Dec 29 04:11:30 1999 +0000
+++ b/distrib/sets/lists/base/mi        Wed Dec 29 04:16:21 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.138 1999/12/24 09:12:55 agc Exp $
+# $NetBSD: mi,v 1.139 1999/12/29 04:16:23 hubertf Exp $
 .
 ./altroot
 ./bin
@@ -783,6 +783,7 @@
 ./usr/share/doc/usd/31.trek
 ./usr/share/examples
 ./usr/share/examples/amd
+./usr/share/examples/apm
 ./usr/share/examples/dhcp
 ./usr/share/examples/emul
 ./usr/share/examples/emul/svr4
diff -r 78186c4107a5 -r 03e2929c0e50 distrib/sets/lists/misc/mi
--- a/distrib/sets/lists/misc/mi        Wed Dec 29 04:11:30 1999 +0000
+++ b/distrib/sets/lists/misc/mi        Wed Dec 29 04:16:21 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.23 1999/12/23 14:38:12 abs Exp $
+# $NetBSD: mi,v 1.24 1999/12/29 04:16:24 hubertf Exp $
 ./usr/share/dict/README
 ./usr/share/dict/eign
 ./usr/share/dict/propernames
@@ -206,6 +206,7 @@
 ./usr/share/examples/amd/cd
 ./usr/share/examples/amd/master
 ./usr/share/examples/amd/net
+./usr/share/examples/apm/script
 ./usr/share/examples/dhcp/dhcpd.conf
 ./usr/share/examples/emul/svr4/etc/SVR4_MAKEDEV
 ./usr/share/examples/emul/svr4/etc/netconfig
diff -r 78186c4107a5 -r 03e2929c0e50 etc/mtree/NetBSD.dist
--- a/etc/mtree/NetBSD.dist     Wed Dec 29 04:11:30 1999 +0000
+++ b/etc/mtree/NetBSD.dist     Wed Dec 29 04:16:21 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist,v 1.94 1999/12/06 22:44:47 simonb Exp $
+#      $NetBSD: NetBSD.dist,v 1.95 1999/12/29 04:16:21 hubertf Exp $
 #      @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93
 
 /set type=dir uname=root gname=wheel mode=0755
@@ -838,6 +838,11 @@
 # ./usr/share/examples/amd
 ..
 
+# ./usr/share/examples/apm
+apm
+# ./usr/share/examples/apm
+..
+
 # ./usr/share/examples/dhcp
 dhcp
 # ./usr/share/examples/dhcp
diff -r 78186c4107a5 -r 03e2929c0e50 share/examples/apm/script
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/examples/apm/script Wed Dec 29 04:16:21 1999 +0000
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+# $NetBSD: script,v 1.1 1999/12/29 04:16:25 hubertf Exp $
+#
+
+#
+# Link this script to /etc/apm/{suspend,standby,resume,line,battery}
+# to play some sounds on suspend/resume, and enable/shutdown the 
+# network card. See apmd(8) for more information.
+#
+
+
+PATH=/usr/pkg/bin:/sbin:$PATH
+export PATH
+
+# Where some sound files are stored:
+S=/usr/X11R6/share/kde/sounds
+
+# What my network card's recognized as:
+if=ne0
+
+
+case $0 in
+*suspend)      
+       logger 'Suspending...'
+       pcmplay -f 22050 -c 1 $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
+       kill `ps -auxwww | grep dhclient | awk '{print $2}'`
+       logger 'Suspending done.'
+       ;;
+
+*standby)
+       logger 'Going to standby mode ....'
+       pcmplay -f 22050 -c 1 $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
+       kill `ps -auxwww | grep dhclient | awk '{print $2}'`
+       logger 'Standby done.'
+       ;;
+
+*resume)
+       logger Resuming...
+       pcmplay -f 22050 $S/KDE_Startup.wav
+       dhclient $if
+       # mount /home
+       # mount /data
+       logger 'Resuming done.'
+       ;;
+
+*line)
+       # pcmplay -f 22050 -c 1 $S/KDE_Window_DeIconify.wav
+       ;;
+
+*battery)
+       # pcmplay -f 22050 -c 1 $S/KDE_Window_DeIconify.wav
+       ;;
+
+esac
+
+exit 0



Home | Main Index | Thread Index | Old Index