Add share/examples/apm/script, an example script to put into

/etc/apm/{line,battery,standby,...}
This commit is contained in:
hubertf 1999-12-29 04:16:21 +00:00
parent 6f51bb4732
commit cabb78b63e
4 changed files with 75 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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 @@ amd
# ./usr/share/examples/amd
..
# ./usr/share/examples/apm
apm
# ./usr/share/examples/apm
..
# ./usr/share/examples/dhcp
dhcp
# ./usr/share/examples/dhcp

65
share/examples/apm/script Executable file
View File

@ -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