]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- added _modprobe function
authorJan Rękorajski <baggins@pld-linux.org>
Fri, 28 Jul 2000 18:37:00 +0000 (18:37 +0000)
committerJan Rękorajski <baggins@pld-linux.org>
Fri, 28 Jul 2000 18:37:00 +0000 (18:37 +0000)
svn-id: @779

rc.d/init.d/functions

index 341c621239c410cce3452e76675a683b8cd479da..4f7c97a6ac97fb4aa0b1c3ae921774f3a1bc72fb 100644 (file)
@@ -1,7 +1,7 @@
 # functions    This file contains functions to be used by most or all
 #              shell scripts in the /etc/init.d directory.
 #
-# $Id: functions,v 1.53 2000/06/02 14:47:49 mkochano Exp $
+# $Id: functions,v 1.54 2000/07/28 18:37:00 baggins Exp $
 #
 # Author:      Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
 # Hacked by:    Greg Galloway and Marc Ewing
@@ -439,3 +439,53 @@ is_no()
                return 1
        return 0
 }
+
+_modprobe()
+{
+       parsed=no
+       while is_no $parsed ; do
+               case "$1" in
+                       "single")
+                               single=yes
+                               shift
+                               ;;
+                       "die")
+                               die=yes
+                               shift
+                               ;;
+                       -*)
+                               args="$args $1"
+                               shift
+                               ;;
+                       *)
+                               parsed=yes
+                               ;;
+               esac
+       done
+       if is_yes "${single}" ; then
+               foo="$@"
+               show "Loading %s kernel module(s)" "$foo"
+               unset foo
+               busy
+       fi
+       if [ -x /sbin/modprobe ] ; then
+               /sbin/modprobe -s $args "$@"
+               result=$?
+       else
+               deltext ; fail
+               result=1
+       fi
+       if is_yes "${single}" ; then
+               deltext
+               if [ $result == "0" ] ; then
+                       is_yes "${single}" && ok
+               else
+                       fail
+                       if is_yes "$die" ; then
+                               nls "Could not load %s kernel module(s)" "$@"
+                               exit 1
+                       fi
+               fi
+       fi
+       unset single die args result
+}
This page took 0.117472 seconds and 4 git commands to generate.