]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blobdiff - iscsi-initiator-utils/04-iscsi
Move all packages to root.
[people/ms/ipfire-3.x.git] / iscsi-initiator-utils / 04-iscsi
diff --git a/iscsi-initiator-utils/04-iscsi b/iscsi-initiator-utils/04-iscsi
new file mode 100755 (executable)
index 0000000..58aa798
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+export LC_ALL=C
+
+if [ "$2" = "down" ]; then
+       if ! /sbin/ip route ls | grep -q ^default &&
+          [ -f /var/lock/subsys/iscsi ]; then
+               /etc/rc.d/init.d/iscsi stop
+       fi
+fi
+
+if [ "$2" = "up" ]; then
+       if /sbin/ip -o route show dev "$1" | grep -q '^default' && 
+          /sbin/chkconfig iscsi; then
+               /etc/rc.d/init.d/iscsi start
+       fi
+fi