[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop:[2939] ipcop/trunk
From:       owes () users ! sourceforge ! net
Date:       2009-05-29 12:00:36
Message-ID: E1MA0lI-0007bn-00 () dn4whf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 2939
          http://ipcop.svn.sourceforge.net/ipcop/?rev=2939&view=rev
Author:   owes
Date:     2009-05-29 12:00:35 +0000 (Fri, 29 May 2009)

Log Message:
-----------
Use and document the use of SSHPORT setting.

Note that both GUIPORT and SSHPORT are 'read-only'. Doing a restore with different \
settings for either one will not work as-is and needs enhancing ipcoprscfg

Modified Paths:
--------------
    ipcop/trunk/config/cfgroot/main-settings
    ipcop/trunk/doc/Configuration-Files
    ipcop/trunk/src/libs/DataAccess.pl
    ipcop/trunk/src/scripts/setreservedports.pl

Modified: ipcop/trunk/config/cfgroot/main-settings
===================================================================
--- ipcop/trunk/config/cfgroot/main-settings	2009-05-29 11:55:36 UTC (rev 2938)
+++ ipcop/trunk/config/cfgroot/main-settings	2009-05-29 12:00:35 UTC (rev 2939)
@@ -4,3 +4,4 @@
 PPPUPDOWNBEEP=on
 JAVASCRIPT=on
 GUIPORT=8443
+SSHPORT=8022

Modified: ipcop/trunk/doc/Configuration-Files
===================================================================
--- ipcop/trunk/doc/Configuration-Files	2009-05-29 11:55:36 UTC (rev 2938)
+++ ipcop/trunk/doc/Configuration-Files	2009-05-29 12:00:35 UTC (rev 2939)
@@ -18,6 +18,7 @@
         TIMEZONE                    used timezone, for example \
                /usr/share/zoneinfo/posix/Europe/Berlin
         DISPLAY_CONNECTIONS         display style for connections.cgi, TRAFFIC or \
STATUS  GUIPORT                     https port in use by GUI
+        SSHPORT                     tcp port in use by SSHd
 
 ================================================================================
 

Modified: ipcop/trunk/src/libs/DataAccess.pl
===================================================================
--- ipcop/trunk/src/libs/DataAccess.pl	2009-05-29 11:55:36 UTC (rev 2938)
+++ ipcop/trunk/src/libs/DataAccess.pl	2009-05-29 12:00:35 UTC (rev 2939)
@@ -129,18 +129,23 @@
     $dServices->{'IPCop proxy'}{'PORT_NR'}  = $proxy;
     $dServices->{'IPCop proxy'}{'PROTOCOL'} = 'tcp';
 
-    my $ssh = '222';
-    if (-e "/etc/ssh/sshd_config") {
-        open(FILE, "/etc/ssh/sshd_config") or die 'Unable to open sshd_config \
                file.';
-        my @current = <FILE>;
-        close(FILE);
-        foreach my $line (@current) {
+    my $ssh = '8022';
+    if (defined($mainsettings{'SSHPORT'})) {
+        $ssh = $mainsettings{'SSHPORT'};
+    }
+    else {
+        if (-e "/etc/ssh/sshd_config") {
+            open(FILE, "/etc/ssh/sshd_config") or die 'Unable to open sshd_config \
file.'; +            my @current = <FILE>;
+            close(FILE);
+            foreach my $line (@current) {
 
-            #Port 222
+                #Port 8022
 
-            if ($line =~ /^Port (\d+)\s*$/) {
-                $ssh = $1;
-                last;
+                if ($line =~ /^Port (\d+)\s*$/) {
+                    $ssh = $1;
+                    last;
+                }
             }
         }
     }

Modified: ipcop/trunk/src/scripts/setreservedports.pl
===================================================================
--- ipcop/trunk/src/scripts/setreservedports.pl	2009-05-29 11:55:36 UTC (rev 2938)
+++ ipcop/trunk/src/scripts/setreservedports.pl	2009-05-29 12:00:35 UTC (rev 2939)
@@ -125,6 +125,11 @@
 {
     print "Changing SSH port to $port\n";
 
+    my %mainsettings = ();
+    &General::readhash('/var/ipcop/main/settings', \%mainsettings);
+    $mainsettings{'SSHPORT'} = $port;
+    &General::writehash('/var/ipcop/main/settings', \%mainsettings);
+
     # Change sshd port
     print "Change sshd configuration ... \n";
     system("/bin/sed", "-i", "-e", "s+Port .*\$+Port $port+", \
"/etc/ssh/sshd_config");


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic