]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/remote.cgi
Rudimentaere ISDN-Erkennung erstellt.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / remote.cgi
index ec4424d246fb63155e3686ac6433f9c90c6d37b7..3b5916d99db1f6392dd811ef5eb9d26ed01507da 100644 (file)
@@ -15,7 +15,7 @@ use strict;
 #use warnings;
 #use CGI::Carp 'fatalsToBrowser';
 
-require 'CONFIG_ROOT/general-functions.pl';
+require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
@@ -31,7 +31,7 @@ $remotesettings{'ENABLE_SSH_PORTFW'} = 'off';
 $remotesettings{'ACTION'} = '';
 &Header::getcgihash(\%remotesettings);
 
-if ($remotesettings{'ACTION'} eq $Lang::tr{'save'})
+if ( (($remotesettings{'ACTION'} eq $Lang::tr{'save'}) || ($remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'}) || ($remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'})) && $remotesettings{'ACTION'} ne "" )
 {
        # not existing here indicates the box is unticked
        $remotesettings{'ENABLE_SSH_PASSWORDS'} = 'off' unless exists $remotesettings{'ENABLE_SSH_PASSWORDS'};
@@ -47,7 +47,7 @@ if ($remotesettings{'ACTION'} eq $Lang::tr{'save'})
                {
                        $errormessage = $Lang::tr{'ssh no auth'};
                }
-               system ('/bin/touch', "${General::swroot}/remote/enablessh");
+               system ('/usr/bin/touch', "${General::swroot}/remote/enablessh");
        }
        else
        {
@@ -63,9 +63,18 @@ if ($remotesettings{'ACTION'} eq $Lang::tr{'save'})
        {
                &General::log($Lang::tr{'ssh1 disabled'});
        }
-
+if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} ){
+       system('/usr/local/bin/restartssh','tempstart15') == 0
+               or $errormessage = "$Lang::tr{'bad return code'} " . $?/256;
+ }
+elsif ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'} ){
+       system('/usr/local/bin/restartssh','tempstart30') == 0
+               or $errormessage = "$Lang::tr{'bad return code'} " . $?/256;
+ }
+else {
        system('/usr/local/bin/restartssh') == 0
                or $errormessage = "$Lang::tr{'bad return code'} " . $?/256;
+ }
 }
 
 &General::readhash("${General::swroot}/remote/settings", \%remotesettings);
@@ -132,7 +141,10 @@ print <<END
        <td width='100%' class='base'>$Lang::tr{'ssh keys'}</td>
 </tr>
 <tr>
-       <td colspan='3' align='center'><hr /><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
+       <td align='center' colspan='3'><hr />
+       <input type='submit' name='ACTION' value='$Lang::tr{'ssh tempstart15'}' />
+       <input type='submit' name='ACTION' value='$Lang::tr{'ssh tempstart30'}' />
+       <input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
 </tr>
 </table>
 END