[dahdi-commits] sruffell: tools/trunk r4579 - /tools/trunk/dahdi.init

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Tue Jul 8 16:27:11 CDT 2008


Author: sruffell
Date: Tue Jul  8 16:27:10 2008
New Revision: 4579

URL: http://svn.digium.com/view/dahdi?view=rev&rev=4579
Log:
Use system default method to show when modules are loaded. 

Still needs refactoring to have one function that works on different
platforms.

Modified:
    tools/trunk/dahdi.init

Modified: tools/trunk/dahdi.init
URL: http://svn.digium.com/view/dahdi/tools/trunk/dahdi.init?view=diff&rev=4579&r1=4578&r2=4579
==============================================================================
--- tools/trunk/dahdi.init (original)
+++ tools/trunk/dahdi.init Tue Jul  8 16:27:10 2008
@@ -154,11 +154,15 @@
 		echo -ne $"Loading DAHDI hardware modules:\n"
 		while read line; do
 			foundone=true
-			echo -ne $"   ${line}..."
-			if ! modprobe $line 2> /dev/null; then
-				echo -ne $"ERROR\n"
-			else
-				echo -ne $"DONE\n"
+			if [ $system = debian ]; then
+					echo -n "   ${line}: " 
+					if modprobe $line 2> /dev/null; then
+					echo -n "done"
+				else
+					echo -n "error"
+				fi
+			elif [ $system = redhat ]; then
+				action "  ${line}: " modprobe $line 
 			fi
 		done
 		echo -ne $"\n"
@@ -210,10 +214,16 @@
   stop)
 	# Unload drivers
 	#shutdown_dynamic # FIXME: needs test from someone with dynamic spans
-	echo -ne $"Unloading DAHDI hardware drivers:"
-  	unload_module dahdi
-	RETVAL=$?
-	echo -ne $" DONE\n"
+	if [ $system = debian ]; then
+		echo -ne $"Unloading DAHDI hardware modules: " 
+		if unload_module dahdi; then
+			echo -n "done"
+		else
+			echo -n "error"
+		fi
+	elif [ $system = redhat ]; then
+		action "Unloading DAHDI hardware modules: " unload_module dahdi 
+	fi
 	if [ "$LOCKFILE" != '' ]; then
 		[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
 	fi




More information about the dahdi-commits mailing list