[LON-CAPA-cvs] cvs: loncom(version_2_8_X) /init.d loncontrol

raeburn raeburn@source.lon-capa.org
Wed, 13 Jan 2010 19:26:54 -0000


raeburn		Wed Jan 13 19:26:54 2010 EDT

  Modified files:              (Branch: version_2_8_X)
    /loncom/init.d	loncontrol 
  Log:
  - Backport part of Firewall.pm rev 1.3 to support cases where loncontrol is used
    on a system where chain is INPUT instead of RH-Firewall-1-INPUT.
  
  
Index: loncom/init.d/loncontrol
diff -u loncom/init.d/loncontrol:1.34 loncom/init.d/loncontrol:1.34.2.1
--- loncom/init.d/loncontrol:1.34	Mon Feb  2 17:06:55 2009
+++ loncom/init.d/loncontrol	Wed Jan 13 19:26:54 2010
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# $Id: loncontrol,v 1.34 2009/02/02 17:06:55 raeburn Exp $
+# $Id: loncontrol,v 1.34.2.1 2010/01/13 19:26:54 raeburn Exp $
 #
 # The LearningOnline Network with CAPA
 #
@@ -67,11 +67,20 @@
 	}
     }
     my $suse_config = "/etc/sysconfig/SuSEfirewall2";
-    if (!-e $suse_config) {
+    if (-e $suse_config) {
+        $fw_chain = 'input_ext';
+    } else {
         if (!-e '/etc/sysconfig/iptables') {
             print("Unable to find iptables file containing static definitions\n");
         }
     }
+    if (-e $iptables) {
+        my $count = `$iptables -L -n 2>/dev/null |grep $fw_chain |wc -l`;
+        chomp($count);
+        if (!$count) {
+            $fw_chain ='INPUT';
+        }
+    }
     my $lond_port = &get_lond_port();
     if (!$lond_port) {
         print("Unable to determine lond port number from LON-CAPA configuration.\n");