diff options
author | Doug Goldstein <cardoe@gentoo.org> | 2002-09-10 22:22:09 +0000 |
---|---|---|
committer | Doug Goldstein <cardoe@gentoo.org> | 2002-09-10 22:22:09 +0000 |
commit | 6af340489409584d14ac40465d8becdd3126e683 (patch) | |
tree | 13f6a7698a7f11343f21e7090bf479fb7f689ad4 /sys-apps/pcmcia-cs | |
parent | Version bumped (diff) | |
download | historical-6af340489409584d14ac40465d8becdd3126e683.tar.gz historical-6af340489409584d14ac40465d8becdd3126e683.tar.bz2 historical-6af340489409584d14ac40465d8becdd3126e683.zip |
Added use logger as a depend of this script
Diffstat (limited to 'sys-apps/pcmcia-cs')
-rw-r--r-- | sys-apps/pcmcia-cs/files/pcmcia.rc7 | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/sys-apps/pcmcia-cs/files/pcmcia.rc7 b/sys-apps/pcmcia-cs/files/pcmcia.rc7 new file mode 100644 index 000000000000..0cc0a642d0df --- /dev/null +++ b/sys-apps/pcmcia-cs/files/pcmcia.rc7 @@ -0,0 +1,65 @@ +#!/sbin/runscript +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/pcmcia-cs/files/pcmcia.rc7,v 1.1 2002/09/10 22:22:09 cardoe Exp $ + +RUN=/var/run +SC=${RUN}/pcmcia-scheme + +depend() +{ + use logger +} + + +cleanup() +{ + while read SN CLASS MOD INST DEV EXTRA ; do + if [ "x${SN}" != "xSocket" ] ; then + /etc/pcmcia/${CLASS} stop ${DEV} 2> /dev/null + fi + done +} + +start() { + local modules_loaded + local code + # Scheme is set for the /etc/pcmcia/shared script + if [ -n "${SCHEME}" ] ; then umask 022 ; echo $SCHEME > ${SC} + else umask 022 ; touch ${SC} + fi + + # clean up any old interfaces + if [ -r ${RUN}/stab ] ; then + cat ${RUN}/stab | cleanup + fi + # if /var/lib/pcmcia exists (and sometimes it gets created accidentally if you run + # pcmcia-cs apps w/out the proper flags), then it will really confuse the process + if [ -d /var/lib/pcmcia ] ; then + rm -rf /var/lib/pcmcia + fi + + if [ -z "`fgrep ds /proc/modules`" ] ; then + modules_loaded="0" + else + modules_loaded="1" + fi + + ebegin "Starting pcmcia" + start-stop-daemon --start --quiet --exec /sbin/cardmgr -- -s ${RUN}/stab ${CARDMGR_OPTS} + code=$? + if [ $code -gt 0 -a $modules_loaded -eq 0 ] ; then + einfo "cardmgr failed to start. Make sure that you have PCMCIA" + einfo "loaded, either as a module or built into the kernel" + fi + eend $code +} + +stop() { + if [ -w ${SC} ] ; then rm -f ${SC} ; fi + + ebegin "Stopping pcmcia" + start-stop-daemon --stop --quiet --pidfile /var/run/cardmgr.pid --retry 5 + eend $? +} + |