Skip to contentSkip to conversation

run only wanted rc

PATCH New Gioele Barabucci 1 participant 1 message May 31, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 run only wanted rc

This patch make hotplug run only .rc files that are executable. In my sistem I use to do chmod -x pci.rc so I avoid complains about pci at boot time.

PS.: hotplug project is using GNU indentation[1]? it seems so, the patch corrects also indentation.

[1] 4 spaces for odd indentation and 1 tab each even indentation Ex.:
base-statement

    child1
    child2
	child2-1
	    child2-1-1
	    child2-1-2
    child3
Signature · 5 lines
Gioele Barabucci (Gb])
) mailto:[email protected]
) http://www.gioelebarabucci.com
) ) I've been and now I've gone
) )          /Magic Pie^Oasis

? indent.patch
Index: hotplug
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/rc.d/init.d/hotplug,v retrieving revision 1.2

hotplug +14 -11
diff -u -3 -p -r1.2 hotplug
@@ -13,29 +13,32 @@
 
 # source function library
 if [ -f /etc/init.d/functions ]; then
-	. /etc/init.d/functions
+    . /etc/init.d/functions
 elif [ -f /etc/rc.d/init.d/functions ]; then
-	. /etc/rc.d/init.d/functions
+    . /etc/rc.d/init.d/functions
 fi
 
 case "$1" in
     start|restart|status)
-	for RC in /etc/hotplug/*.rc
-	do
-	    $RC $1
+	for RC in /etc/hotplug/*.rc; do
+	    if [ -x $RC ]; then
+		$RC $1 
+	    fi
 	done
 	touch /var/lock/subsys/hotplug
 	;;
     stop)
-	for RC in /etc/hotplug/*.rc
-        do
-            $RC stop
-        done
-        rm -f /var/lock/subsys/hotplug
-        ;;
+	for RC in /etc/hotplug/*.rc; do
+	    if [ -x $RC ]; then
+		$RC stop
+	    fi
+	done
+	rm -f /var/lock/subsys/hotplug
+	;;
 
     *)
     echo $"Usage: $0 {start|stop|restart|status}"
     exit 1
     ;;
 esac
+