]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
UPNP.CGI hinzugefuegt
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 12 Feb 2007 18:04:28 +0000 (18:04 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 12 Feb 2007 18:04:28 +0000 (18:04 +0000)
SAMBA.CGI von Maniakikarus hinzugefuegt
Bootskripte bearbeitet
IPFIRE-DEVEL erstellt.

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@410 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

14 files changed:
config/cfgroot/header.pl
config/rootfiles/common/apache2
config/rootfiles/common/configroot
config/rootfiles/ver_devel/devel [new file with mode: 0644]
html/cgi-bin/samba.cgi
html/cgi-bin/upnp.cgi [new file with mode: 0644]
lfs/cdrom
lfs/configroot
make.sh
src/initscripts/init.d/applejuice
src/initscripts/init.d/console
src/initscripts/init.d/localnet
src/initscripts/init.d/network
src/initscripts/init.d/upnpd

index 3a8adde121834bb205b81d4ae2dde6f5cbf31684..a80d5880e423cb540da0b8fe68727455cc29185e 100644 (file)
@@ -360,7 +360,13 @@ sub genmenu {
                                'title' => "$tr{'outgoing firewall'}",
                                'enabled' => 1,
                                };
-    $subfirewall->{'60.fwopts'} = {
+    $subfirewall->{'60.upnp'} = {
+                               'caption' => 'UPnP',
+                               'uri' => '/cgi-bin/upnp.cgi',
+                               'title' => "Universal Plug and Play",
+                               'enabled' => 1,
+                               };
+    $subfirewall->{'70.fwopts'} = {
                                'caption' => $tr{'options fw'},
                                'uri' => '/cgi-bin/optionsfw.cgi',
                                'title' => "$tr{'options fw'}",
index 6ae9464d4a1a42150bee3e9b5522e908a977fa15..c89c6fdb4e6482dcb915ee65f67681c0ee27532c 100644 (file)
@@ -1316,6 +1316,7 @@ srv/web/ipfire/cgi-bin/time.cgi
 srv/web/ipfire/cgi-bin/traffic.cgi
 srv/web/ipfire/cgi-bin/traffics.cgi
 srv/web/ipfire/cgi-bin/upload.cgi
+srv/web/ipfire/cgi-bin/upnp.cgi
 srv/web/ipfire/cgi-bin/urlfilter.cgi
 srv/web/ipfire/cgi-bin/vpnmain.cgi
 srv/web/ipfire/cgi-bin/wakeonlan.cgi
index b0d22926b9ccb261a9a13067ca3b8b4030c13c3b..48d67f3614dae4f2aa17ad867fd2332a97ce0bcb 100644 (file)
@@ -112,6 +112,8 @@ var/ipfire/time
 var/ipfire/urlfilter
 #var/ipfire/urlfilter/autoupdate
 #var/ipfire/urlfilter/bin
+var/ipfire/upnp
+#var/ipfire/upnp/settings
 var/ipfire/vpn
 #var/ipfire/vpn/caconfig
 #var/ipfire/vpn/config
diff --git a/config/rootfiles/ver_devel/devel b/config/rootfiles/ver_devel/devel
new file mode 100644 (file)
index 0000000..32bb7c3
--- /dev/null
@@ -0,0 +1,30 @@
+bin
+boot
+etc
+home
+install
+lib
+media
+mnt
+opt
+root
+sbin
+srv
+tmp
+#tools
+usr/bin
+usr/etc
+usr/include
+usr/info
+usr/java
+usr/lib
+usr/libexec
+usr/local
+usr/man
+usr/nagios
+usr/sbin
+usr/share
+usr/sieve
+#usr/src
+usr/var
+var
index ecdd2561dbff07c2b69d47039962421a867e86a3..d70f87ab9b555dcd7ee4692feed26885ef65af57 100644 (file)
@@ -19,6 +19,7 @@ require "${General::swroot}/header.pl";
 my %sambasettings = ();
 my %checked = ();
 my %netsettings = ();
+my %ovpnsettings = ();
 my $message = "";
 my $errormessage = "";
 my $shareentry = "";
@@ -28,12 +29,13 @@ my @proto = ();
 my %selected= () ;
 my $sharefile = "/var/ipfire/samba/shares";
 &General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+&General::readhash("${General::swroot}/ovpn/settings", \%ovpnsettings);
 
 my %servicenames =
 (
-       'SMB Daemon' => 'smbd',
-       'NetBIOS Nameserver' => 'nmbd',
-       'Winbind Daemon' => 'winbindd'
+        'SMB Daemon' => 'smbd',
+        'NetBIOS Nameserver' => 'nmbd',
+        'Winbind Daemon' => 'winbindd'
 );
 
 &Header::showhttpheaders();
@@ -44,10 +46,14 @@ $sambasettings{'VALID'} = 'yes';
 $sambasettings{'WORKGRP'} = 'homeip.net';
 $sambasettings{'NETBIOSNAME'} = 'IPFIRE';
 $sambasettings{'SRVSTRING'} = 'Samba Server %v running on IPFire 2.0';
-$sambasettings{'INTERFACES'} = '';
+$sambasettings{'INTERFACES'} = 'eth0';
 $sambasettings{'SECURITY'} = 'share';
 $sambasettings{'OSLEVEL'} = '20';
 $sambasettings{'PDC'} = 'off';
+$sambasettings{'GREEN'} = 'on';
+$sambasettings{'BLUE'} = 'off';
+$sambasettings{'ORANGE'} = 'off';
+$sambasettings{'VPN'} = 'off';
 $sambasettings{'WINSSERV'} = '';
 $sambasettings{'WINS'} = 'off';
 ### Values that have to be initialized
@@ -64,16 +70,16 @@ $sambasettings{'ACTION'} = '';
 
 if ($sambasettings{'ACTION'} eq $Lang::tr{'save'})
 {
-       &General::writehash("${General::swroot}/samba/settings", \%sambasettings);
+        &General::writehash("${General::swroot}/samba/settings", \%sambasettings);
 }
 
 &General::readhash("${General::swroot}/samba/settings", \%sambasettings);
 
 if ($errormessage) {
-       &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
-       print "<class name='base'>$errormessage\n";
-       print "&nbsp;</class>\n";
-       &Header::closebox();
+        &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+        print "<class name='base'>$errormessage\n";
+        print "&nbsp;</class>\n";
+        &Header::closebox();
 }
 
 $checked{'PDC'}{'on'} = '';
@@ -82,91 +88,125 @@ $checked{'PDC'}{"$sambasettings{'PDC'}"} = 'checked';
 $checked{'WINS'}{'on'} = '';
 $checked{'WINS'}{'off'} = '';
 $checked{'WINS'}{"$sambasettings{'WINS'}"} = 'checked';
+$checked{'GREEN'}{'on'} = '';
+$checked{'GREEN'}{'off'} = '';
+$checked{'GREEN'}{"$sambasettings{'GREEN'}"} = 'checked';
+$checked{'BLUE'}{'on'} = '';
+$checked{'BLUE'}{'off'} = '';
+$checked{'BLUE'}{"$sambasettings{'BLUE'}"} = 'checked';
+$checked{'ORANGE'}{'on'} = '';
+$checked{'ORANGE'}{'off'} = '';
+$checked{'ORANGE'}{"$sambasettings{'ORANGE'}"} = 'checked';
+$checked{'VPN'}{'on'} = '';
+$checked{'VPN'}{'off'} = '';
+$checked{'VPN'}{"$sambasettings{'VPN'}"} = 'checked';
+
+$selected{'MAPTOGUEST'}{'Never'} = '';
+$selected{'MAPTOGUEST'}{'Bad User'} = '';
+$selected{'MAPTOGUEST'}{'Bad Password'} = '';
+$selected{'MAPTOGUEST'}{$sambasettings{'MAPTOGUEST'}} = "selected='selected'";
+$selected{'SECURITY'}{'share'} = '';
+$selected{'SECURITY'}{'user'} = '';
+$selected{'SECURITY'}{'server'} = '';
+$selected{'SECURITY'}{'domain'} = '';
+$selected{'SECURITY'}{$sambasettings{'SECURITY'}} = "selected='selected'";
 
 ############################################################################################################################
 ############################################################################################################################
 
 &Header::openbox('100%', 'center', 'Samba');
 print <<END
-       <table width='400px' cellspacing='0'>
+        <table width='400px' cellspacing='0'>
 END
 ;
-       if ( $message ne "" ) {
-               print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
-       }
-
-       my $lines = 0;
-       my $key = '';
-       foreach $key (sort keys %servicenames)
-       {
-               if ($lines % 2) {
-                       print "<tr bgcolor='${Header::table1colour}'>\n"; }
-               else {
-                       print "<tr bgcolor='${Header::table2colour}'>\n"; }
-               print "<td align='left'>$key</td>\n";
-               my $shortname = $servicenames{$key};
-               my $status = &isrunning($shortname);
-               print "$status\n";
-               print <<END
-                       <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-                               <input type='hidden' name='ACTION' value='restart $shortname'>
-                               <input type='image' src='/images/reload.gif'>
-                       </form></td>
+        if ( $message ne "" ) {
+                print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
+        }
+
+        my $lines = 0;
+        my $key = '';
+        foreach $key (sort keys %servicenames)
+        {
+                if ($lines % 2) {
+                        print "<tr bgcolor='${Header::table1colour}'>\n"; }
+                else {
+                        print "<tr bgcolor='${Header::table2colour}'>\n"; }
+                print "<td align='left'>$key</td>\n";
+                my $shortname = $servicenames{$key};
+                my $status = &isrunning($shortname);
+                print "$status\n";
+                print <<END
+                        <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                <input type='hidden' name='ACTION' value='restart $shortname'>
+                                <input type='image' src='/images/reload.gif'>
+                        </form></td>
 END
 ;
-               print "</tr>\n";
-               $lines++;
-       }
-       print <<END
-               <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-               <tr><td><b>Alle Dienste:</b></td><td colspan='2'>
-               <input type='submit' name='ACTION' value='Start' /> 
-               <input type='submit' name='ACTION' value='Stop' /> 
-               <input type='submit' name='ACTION' value='$Lang::tr{'restart'}' />
-               </td></tr></form>
-       </table>
-       <hr>
-       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-       <table width='500px'>
-       <tr><td colspan='2' align='left'><b>Basisoptionen</b>
-       <tr><td align='left'>Workgroup:<td><input type='text' name='WORKGRP' value='$sambasettings{'WORKGRP'}'>
-       <tr><td align='left'>NetBIOS-Name:<td><input type='text' name='NETBIOSNAME' value='$sambasettings{'NETBIOSNAME'}'>
-       <tr><td align='left'>Server-String:<td><input type='text' name='SRVSTRING' value='$sambasettings{'SRVSTRING'}'>
-       <tr><td align='left'>Interfaces:<td><select name='INTERFACES'>
-                                                       <option value='$netsettings{'GREEN_DEV'}'>GREEN</option>
+                print "</tr>\n";
+                $lines++;
+        }
+        print <<END
+                <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                <tr><td><b>Alle Dienste:</b></td><td colspan='2'>
+                <input type='submit' name='ACTION' value='Start' /> 
+                <input type='submit' name='ACTION' value='Stop' /> 
+                <input type='submit' name='ACTION' value='$Lang::tr{'restart'}' />
+                </td></tr></form>
+        </table>
+        <hr>
+        <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+        <table width='500px'>
+        <tr><td colspan='2' align='left'>
+        <tr><td colspan='2' align='left'>
+        <tr><td colspan='2' align='left'><b>Basisoptionen</b>
+        <tr><td align='left'>Workgroup:<td><input type='text' name='WORKGRP' value='$sambasettings{'WORKGRP'}'>
+        <tr><td align='left'>NetBIOS-Name:<td><input type='text' name='NETBIOSNAME' value='$sambasettings{'NETBIOSNAME'}'>
+        <tr><td align='left'>Server-String:<td><input type='text' name='SRVSTRING' value='$sambasettings{'SRVSTRING'}'>
+        <tr><td align='left'>Interfaces:<td><input type='checkbox' name='VPN' $checked{'VPN'}{'on'}><font size='2' color='$Header::colourovpn'><b>   OpenVpn  -  $ovpnsettings{'DDEVICE'}
+        <tr><td align='left'><td><input type='checkbox' name='GREEN' $checked{'GREEN'}{'on'}><font size='2' color='$Header::colourgreen'><b>   $Lang::tr{'green'}  -  $netsettings{'GREEN_DEV'}
 END
 ;
-                                               if (&Header::blue_used()){
-                                                       print <<END
-                                                       <option value='$netsettings{'BLUE_DEV'}'>BLUE</option>
-                                                       <option value='$netsettings{'GREEN_DEV'},$netsettings{'BLUE_DEV'}'>GREEN & BLUE</option>
+         if (&Header::blue_used()){
+         print <<END
+         <tr><td align='left'><td><input type='checkbox' name='BLUE' $checked{'BLUE'}{'on'}><font size='2' color='$Header::colourblue'><b>   $Lang::tr{'wireless'}  -  $netsettings{'BLUE_DEV'}
 END
 ;
-                                               }
-       print <<END
+                                    }
+         if (&Header::orange_used()){
+         print <<END
+         <tr><td align='left'><td><input type='checkbox' name='ORANGE' $checked{'ORANGE'}{'on'}><font size='2' color='$Header::colourorange'><b>   $Lang::tr{'dmz'}  -  $netsettings{'ORANGE_DEV'}
+END
+;
+                                    }
+        print <<END
 </select>
+        <tr><td colspan='2' align='left'>
+        <tr><td colspan='2' align='left'>
+        <tr><td colspan='2' align='left'><b>Sicherheitsoptionen</b>
+        <tr><td align='left'>Security:<td><select name='SECURITY'>
+                                                        <option value='share' $selected{'SECURITY'}{'share'}>SHARE</option>
+                                                        <option value='user' $selected{'SECURITY'}{'user'}>USER</option>
+                                                        <option value='server' $selected{'SECURITY'}{'server'}>SERVER</option>
+                                                        <option value='domain' $selected{'SECURITY'}{'domain'}>DOMAIN</option>
+                                                </select>
+
+        <tr><td colspan='2' align='left'>
+        <tr><td colspan='2' align='left'>
+        <tr><td colspan='2' align='left'><b>Browsingoptionen</b>
+        <tr><td align='left'>OS Level:<td><input type='text' name='OSLEVEL' value='$sambasettings{'OSLEVEL'}'>
+        <tr><td align='left'>Primary Domain Controller:<td>on   <input type='radio' name='PDC' value='on' $checked{'PDC'}{'on'}>/
+                                                                        <input type='radio' name='PDC' value='off' $checked{'PDC'}{'off'}> off
 
-       <tr><td colspan='2' align='left'><b>Sicherheitsoptionen</b>
-       <tr><td align='left'>Security:<td><select name='SECURITY'>
-                                                       <option value='share'>SHARE</option>
-                                                       <option value='user'>USER</option>
-                                                       <option value='server'>SERVER</option>
-                                                       <option value='domain'>DOMAIN</option>
-                                               </select>
-
-       <tr><td colspan='2' align='left'><b>Browsingoptionen</b>
-       <tr><td align='left'>OS Level:<td><input type='text' name='OSLEVEL' value='$sambasettings{'OSLEVEL'}'>
-       <tr><td align='left'>Primary Domain Controller:<td>on   <input type='radio' name='PDC' value='on' $checked{'PDC'}{'on'}>/
-                                                                       <input type='radio' name='PDC' value='off' $checked{'PDC'}{'off'}> off
-
-       <tr><td colspan='2' align='left'><b>WINS-Optionen</b>
-       <tr><td align='left'>WINS-Server:<td><input type='text' name='WINSSRV' value='$sambasettings{'WINSSRV'}'>
-       <tr><td align='left'>WINS-Support:<td>on        <input type='radio' name='WINS' value='on' $checked{'WINS'}{'on'}>/
-                                                       <input type='radio' name='WINS' value='off' $checked{'WINS'}{'off'}> off
-
-       <tr><td colspan='2' align='right'><input type='submit' name='ACTION' value=$Lang::tr{'save'}>
-       </table>
-       </form>
+        <tr><td colspan='2' align='left'>
+        <tr><td colspan='2' align='left'>
+        <tr><td colspan='2' align='left'><b>WINS-Optionen</b>
+        <tr><td align='left'>WINS-Server:<td><input type='text' name='WINSSRV' value='$sambasettings{'WINSSRV'}'>
+        <tr><td align='left'>WINS-Support:<td>on        <input type='radio' name='WINS' value='on' $checked{'WINS'}{'on'}>/
+                                                        <input type='radio' name='WINS' value='off' $checked{'WINS'}{'off'}> off
+
+        <tr><td colspan='1' align='right'><input type='submit' name='ACTION' value=$Lang::tr{'save'}>
+        </table>
+        </form>
 END
 ;
 &Header::closebox();
@@ -174,64 +214,82 @@ END
 &Header::openbox('100%', 'center', 'Shares');
 
 print <<END
-       <table width='500'>
-       <tr><th width='40%'>Name der Freigabe<th width='40%'>Pfad<th width='20%'>Optionen
+        <hr>
+        <table width='500'>
+        <tr><th width='40%'>Name der Freigabe<th width='40%'>Pfad<th width='20%'>Optionen
+END
+;
+        open( FILE, "< $sharefile" ) or die "Unable to read $sharefile";
+        @shares = <FILE>;
+        close FILE;
+        foreach $shareentry (sort @shares)
+        {
+                @shareline = split( /\;/, $shareentry );
+                print <<END
+                <tr><td align='center' bgcolor='#EAEAEA'><b>$shareline[0]</b>
+                    <td align='center' bgcolor='#EAEAEA'>$shareline[2]
+                    <td align='right'  bgcolor='#EAEAEA'>
+                        <table border='0'><tr>
 END
 ;
-       open( FILE, "< $sharefile" ) or die "Unable to read $sharefile";
-       @shares = <FILE>;
-       close FILE;
-       foreach $shareentry (sort @shares)
-       {
-               @shareline = split( /\;/, $shareentry );
-               print <<END
-               <tr><td align='center' bgcolor='#EAEAEA'><b>$shareline[0]</b>
-                   <td align='center' bgcolor='#EAEAEA'>$shareline[2]
-                   <td align='right'  bgcolor='#EAEAEA'>
-                       <table border='0'><tr>
+                if ($shareline[1] eq 'enabled') {
+                        print <<END
+                                <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                        <input type='hidden' name='NAME' value='shareline[0]'>
+                                        <input type='hidden' name='ACTION' value='disable'>
+                                        <input type='image' alt='Ausschalten' src='/images/on.gif'>
+                                </form>
 END
 ;
-               if ($shareline[1] eq 'enabled') {
-                       print <<END
-                               <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-                                       <input type='hidden' name='NAME' value='shareline[0]'>
-                                       <input type='hidden' name='ACTION' value='disable'>
-                                       <input type='image' alt='Ausschalten' src='/images/on.gif'>
-                               </form>
+                } elsif ($shareline[1] eq 'disabled') {
+                        print <<END
+                                <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                        <input type='hidden' name='NAME' value='shareline[0]'>
+                                        <input type='hidden' name='ACTION' value='enable'>
+                                        <input type='image' alt='Einschalten' src='/images/off.gif'>
+                                </form>
 END
 ;
-               } elsif ($shareline[1] eq 'disabled') {
-                       print <<END
-                               <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-                                       <input type='hidden' name='NAME' value='shareline[0]'>
-                                       <input type='hidden' name='ACTION' value='enable'>
-                                       <input type='image' alt='Einschalten' src='/images/off.gif'>
-                               </form>
+                }
+                print <<END
+                        <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                <input type='hidden' name='NAME' value='shareline[0]'>
+                                <input type='hidden' name='ACTION' value='Bearbeiten'>
+                                <input type='image' alt='Bearbeiten' src='/images/edit.gif'>
+                        </form>
+                        <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+                                <input type='hidden' name='NAME' value='shareline[0]'>
+                                <input type='hidden' name='ACTION' value='Loeschen'>
+                                <input type='image' alt='Loeschen' src='/images/delete.gif'>
+                        </form>
+                        </table>
 END
 ;
-               }
-               print <<END
-                       <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-                               <input type='hidden' name='NAME' value='shareline[0]'>
-                               <input type='hidden' name='ACTION' value='Bearbeiten'>
-                               <input type='image' alt='Bearbeiten' src='/images/edit.gif'>
-                       </form>
-                       <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-                               <input type='hidden' name='NAME' value='shareline[0]'>
-                               <input type='hidden' name='ACTION' value='Loeschen'>
-                               <input type='image' alt='Loeschen' src='/images/delete.gif'>
-                       </form>
-                       </table>
+        }
+        print <<END
+        <tr><td colspan='8' align='right' valign='middle'><b>Legende:</b>&nbsp;&nbsp;<img src='/images/edit.gif'>&nbsp;Freigabe bearbeiten | <img src='/images/delete.gif'>&nbsp;Freigabe loeschen &nbsp;
+        </table>
 END
 ;
-       }
-       print <<END
-       <tr><td colspan='8' align='right' valign='middle'><b>Legende:</b>&nbsp;&nbsp;<img src='/images/edit.gif'>&nbsp;Freigabe bearbeiten | <img src='/images/delete.gif'>&nbsp;Freigabe loeschen &nbsp;
-       </table>
+
+&Header::closebox();
+
+
+if ($sambasettings{'SECURITY'} eq 'user')
+{
+&Header::openbox('100%', 'center', 'User');
+
+print <<END
+        <hr>        
+        <table width='500'>
+        <tr><td colspan='2' align='left'>
+        <tr><td colspan='2' align='left'><b>Benutzerverwaltung</b>
+        </table>
 END
 ;
 
 &Header::closebox();
+}
 
 &Header::closebigbox();
 &Header::closepage();
@@ -241,34 +299,33 @@ END
 
 sub isrunning
 {
-       my $cmd = $_[0];
-       my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
-       my $pid = '';
-       my $testcmd = '';
-       my $exename;
-
-       $cmd =~ /(^[a-z]+)/;
-       $exename = $1;
-
-       if (open(FILE, "/var/run/${cmd}.pid"))
-       {
-               $pid = <FILE>; chomp $pid;
-               close FILE;
-               if (open(FILE, "/proc/${pid}/status"))
-               {
-                       while (<FILE>)
-                       {
-                               if (/^Name:\W+(.*)/) {
-                                       $testcmd = $1; }
-                       }
-                       close FILE;
-                       if ($testcmd =~ /$exename/)
-                       {
-                               $status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
-                       }
-               }
-       }
-
-       return $status;
-}
+        my $cmd = $_[0];
+        my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
+        my $pid = '';
+        my $testcmd = '';
+        my $exename;
+
+        $cmd =~ /(^[a-z]+)/;
+        $exename = $1;
 
+        if (open(FILE, "/var/run/${cmd}.pid"))
+        {
+                $pid = <FILE>; chomp $pid;
+                close FILE;
+                if (open(FILE, "/proc/${pid}/status"))
+                {
+                        while (<FILE>)
+                        {
+                                if (/^Name:\W+(.*)/) {
+                                        $testcmd = $1; }
+                        }
+                        close FILE;
+                        if ($testcmd =~ /$exename/)
+                        {
+                                $status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
+                        }
+                }
+        }
+
+        return $status;
+}
diff --git a/html/cgi-bin/upnp.cgi b/html/cgi-bin/upnp.cgi
new file mode 100644 (file)
index 0000000..4623d72
--- /dev/null
@@ -0,0 +1,181 @@
+#!/usr/bin/perl
+#
+# IPFire CGIs
+#
+# This code is distributed under the terms of the GPL
+#
+# (c) The IPFire Team
+#
+
+use strict;
+# enable only the following on debugging purpose
+use warnings;
+use CGI::Carp 'fatalsToBrowser';
+
+require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/lang.pl";
+require "${General::swroot}/header.pl";
+
+my %upnpsettings = ();
+my %checked = ();
+my %netsettings = ();
+my $message = "";
+my $errormessage = "";
+my %selected= () ;
+&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+
+my %servicenames =
+(
+       'UPnP Daemon' => 'upnpd',
+);
+
+&Header::showhttpheaders();
+
+$upnpsettings{'ENABLED'} = 'off';
+$upnpsettings{'GREEN'} = 'on';
+$upnpsettings{'BLUE'} = 'off';
+### Values that have to be initialized
+$upnpsettings{'ACTION'} = '';
+
+&General::readhash("${General::swroot}/upnp/settings", \%upnpsettings);
+&Header::getcgihash(\%upnpsettings);
+
+&Header::openpage('UPnP', 1, '');
+&Header::openbigbox('100%', 'left', '', $errormessage);
+
+############################################################################################################################
+############################################################################################################################
+
+if ($upnpsettings{'ACTION'} eq $Lang::tr{'save'})
+{
+       &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
+} 
+elsif ($upnpsettings{'ACTION'} eq 'Start')
+{
+       $upnpsettings{'ENABLED'} = 'on';
+       &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
+       system('/usr/local/bin/upnpctrl start');
+} 
+elsif ($upnpsettings{'ACTION'} eq 'Stop')
+{
+       $upnpsettings{'ENABLED'} = 'off';
+       &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
+       system('/usr/local/bin/upnpctrl stop');
+} 
+elsif ($upnpsettings{'ACTION'} eq $Lang::tr{'restart'})
+{
+       &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
+       system('/usr/local/bin/upnpctrl restart');
+}
+
+&General::readhash("${General::swroot}/upnp/settings", \%upnpsettings);
+
+if ($errormessage) {
+       &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+       print "<class name='base'>$errormessage\n";
+       print "&nbsp;</class>\n";
+       &Header::closebox();
+}
+
+$checked{'GREEN'}{'on'} = '';
+$checked{'GREEN'}{'off'} = '';
+$checked{'GREEN'}{"$upnpsettings{'GREEN'}"} = 'checked';
+$checked{'BLUE'}{'on'} = '';
+$checked{'BLUE'}{'off'} = '';
+$checked{'BLUE'}{"$upnpsettings{'BLUE'}"} = 'checked';
+
+############################################################################################################################
+############################################################################################################################
+
+&Header::openbox('100%', 'center', 'UPnP');
+print <<END
+       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+       <table width='400' cellspacing='0'>
+END
+;
+       if ( $message ne "" ) {
+               print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
+       }
+
+       my $lines = 0;
+       my $key = '';
+       foreach $key (sort keys %servicenames)
+       {
+               if ($lines % 2) {
+                       print "<tr bgcolor='${Header::table1colour}'>\n"; }
+               else {
+                       print "<tr bgcolor='${Header::table2colour}'>\n"; }
+               print "<td align='left'>$key\n";
+               my $shortname = $servicenames{$key};
+               my $status = &isrunning($shortname);
+               print "$status\n";
+               $lines++;
+       }
+       print <<END
+               <tr><td><b>Alle Dienste:</b></td><td colspan='2'>
+               <input type='submit' name='ACTION' value='Start' /> 
+               <input type='submit' name='ACTION' value='Stop' /> 
+               <input type='submit' name='ACTION' value='$Lang::tr{'restart'}' />
+       </table>
+       </form>
+       <hr />
+       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+       <table width='500'>
+       <tr><td colspan='2' align='left'><b>$Lang::tr{'options'}</b>
+        <tr><td align='left'>$Lang::tr{'interfaces'}
+            <td align='left'>&nbsp;<td><input type='checkbox' name='GREEN' $checked{'GREEN'}{'on'} /> <font size='2' color='$Header::colourgreen'><b>$Lang::tr{'green'} - $netsettings{'GREEN_DEV'}</b></font>
+END
+;
+         if (&Header::blue_used()){
+         print <<END
+         <tr><td align='left'>&nbsp;<td><input type='checkbox' name='BLUE' $checked{'BLUE'}{'on'} /> <font size='2' color='$Header::colourblue'><b>$Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}</b></font>
+END
+;
+                                    }
+        print <<END
+       <tr><td colspan='2' align='right'><input type='submit' name='ACTION' value=$Lang::tr{'save'} />
+       </table>
+       </form>
+END
+;
+&Header::closebox();
+
+&Header::closebigbox();
+&Header::closepage();
+
+############################################################################################################################
+############################################################################################################################
+
+sub isrunning
+{
+       my $cmd = $_[0];
+       my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
+       my $pid = '';
+       my $testcmd = '';
+       my $exename;
+
+       $cmd =~ /(^[a-z]+)/;
+       $exename = $1;
+
+       if (open(FILE, "/var/run/${cmd}.pid"))
+       {
+               $pid = <FILE>; chomp $pid;
+               close FILE;
+               if (open(FILE, "/proc/${pid}/status"))
+               {
+                       while (<FILE>)
+                       {
+                               if (/^Name:\W+(.*)/) {
+                                       $testcmd = $1; }
+                       }
+                       close FILE;
+                       if ($testcmd =~ /$exename/)
+                       {
+                               $status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
+                       }
+               }
+       }
+
+       return $status;
+}
+
index 33fc9a8a794b6a3604c3ce32e39792600af4d00b..6f14c9ec23cd9d47571e2ca6f84d6babd12a6148 100644 (file)
--- a/lfs/cdrom
+++ b/lfs/cdrom
@@ -54,10 +54,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        # Reason for this tar+untar+tar is removing of entries listed two or more in src/ROOTFILES
        mkdir -p /install/cdrom/doc
        find $(DIR_SRC)/config/rootfiles/common -maxdepth 1 -type f | xargs cat >> /tmp/ROOTFILES
-       find $(DIR_SRC)/config/rootfiles/ver_$(IPFVER) -maxdepth 1 -type f | xargs cat >> /tmp/ROOTFILES
+       find $(DIR_SRC)/config/rootfiles/ver_$(ED) -maxdepth 1 -type f | xargs cat >> /tmp/ROOTFILES
        tar -c -C / --files-from=/tmp/ROOTFILES \
                -f /$(SNAME).tar --exclude='#*' --exclude='dev/pts/*' \
-               --exclude='proc/*' --exclude='tmp/ROOTFILES'
+               --exclude='proc/*' --exclude='usr/src/ccache/*' --exclude='usr/src/cache/*' \
+               --exclude='tmp/ROOTFILES'
        rm -f /tmp/ROOTFILES
        tar -x -C /tmp -f /$(SNAME).tar
        rm -f /$(SNAME).tar
@@ -86,4 +87,4 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        cp /usr/lib/syslinux/isolinux.bin           /install/cdrom/boot/isolinux/isolinux.bin; \
        cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
            -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
-           -c boot/isolinux/boot.catalog . > /install/images/$(SNAME)-$(VERSION).$(MACHINE)-$(IPFVER).iso
+           -c boot/isolinux/boot.catalog . > /install/images/$(SNAME)-$(VERSION).$(MACHINE)-$(ED).iso
index 2a33bc6233f11a80b5a20f78a7079aa21eae8972..27c2abd906ba6e8cdb9c6ae98b34e24e4b348212 100644 (file)
@@ -54,7 +54,7 @@ $(TARGET) :
        # Create all directories
        for i in addon-lang alcatelusb auth backup ca certs cnx_pci connscheduler crls ddns dhcp dhcpc dmzholes \
            eagle-usb eciadsl ethernet isdn key langs logging main mbmon modem net-traffic nfs optionsfw outgoing/bin patches pakfire portfw \
-           ppp private proxy/advanced qos/bin red remote snort time urlfilter/autoupdate urlfilter/bin vpn wakeonlan wireless xtaccess ; do \
+           ppp private proxy/advanced qos/bin red remote snort time urlfilter/autoupdate urlfilter/bin upnp vpn wakeonlan wireless xtaccess ; do \
                mkdir -p $(CONFIG_ROOT)/$$i; \
        done
 
@@ -65,7 +65,7 @@ $(TARGET) :
            isdn/settings main/hosts main/settings optionsfw/settings outgoing/settings outgoing/rules pakfire/settings \
            portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \
            ppp/settings-5 ppp/settings proxy/settings proxy/advanced/settings remote/settings qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \
-           qos/tosconfig snort/settings vpn/config vpn/settings vpn/ipsec.conf \
+           qos/tosconfig snort/settings upnp/settings vpn/config vpn/settings vpn/ipsec.conf \
            vpn/ipsec.secrets vpn/caconfig wakeonlan/clients.conf wireless/config wireless/settings; do \
                touch $(CONFIG_ROOT)/$$i; \
        done
diff --git a/make.sh b/make.sh
index e383b05313cffdce84c2abc8c174bc812bce2827..fed147e44b22d71118addfcbbe8466c9d9c69043 100644 (file)
--- a/make.sh
+++ b/make.sh
@@ -33,7 +33,7 @@ KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
 MACHINE=`uname -m`
 SVN_REVISION=`svn info | grep Revision | cut -c 11-`
 
-IPFVER="full"                          # Which version should be compiled? (full|light|voice)
+IPFVER="full devel"                            # Which version should be compiled? (full|light|voice|devel)
 
 # Set an information about the build number
 if [ -e ./.svn ]; then
@@ -575,7 +575,10 @@ buildpackages() {
   beautify message DONE
 
   # Create images for install
-  ipfiremake cdrom
+  for i in $IPFVER
+  do
+       ipfiremake cdrom ED=$i
+  done
   ipfiremake pxe
   cp -f $LFS/install/images/{*.iso,*.tgz} $BASEDIR >> $LOGFILE 2>&1
 
index cdb0655dceb0d0263b97d1606be09a1f5357abfa..5ea1227b0df3fa619b18feff73843d585d96c80b 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/bash
 HOME=/opt/applejuice
 JAVA=/usr/bin/java
-. /var/ipfire/applejuice/settings
+eval $(/usr/local/bin/readhash /var/ipfire/applejuice/settings)
 
 
 case "$1" in
index 30f5bdfafc14f50438de1ced21dcbb7a7b564edf..cbf3aaf68b4b7c6a5a3316210f856684633c765d 100644 (file)
@@ -15,7 +15,7 @@
 
 . /etc/sysconfig/rc
 . ${rc_functions}
-. /var/ipfire/main/settings
+eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
 
 FONT="lat0-16"
 KEYMAP_CORRECTIONS="euro2"
index a3b70162d8b0da80d95a824f6473533466d613b0..9f38f34dc22c459a1bf10a409c2da7f1d9a2c2ea 100644 (file)
@@ -17,7 +17,7 @@
 
 case "${1}" in
        start)
-               . /var/ipfire/main/settings
+               eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
                boot_mesg "Bringing up the loopback interface..."
                ip addr add 127.0.0.1/8 label lo dev lo
                ip link set lo up
@@ -41,7 +41,7 @@ case "${1}" in
                ;;
 
        status)
-               . /var/ipfire/main/settings
+               eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
                echo "Hostname is: $(hostname)"
                ip link show lo
                ;;
index 9e2056f3a04ece310fef109f9cb2f85dd93592d4..6669b28a1c7e9a7ef84bd816ec7587c47ec136bc 100644 (file)
 
 . /etc/sysconfig/rc
 . ${rc_functions}
-. /var/ipfire/ethernet/settings
-. /var/ipfire/dhcp/settings
-. /var/ipfire/ppp/settings
-. /var/ipfire/vpn/settings
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+eval $(/usr/local/bin/readhash /var/ipfire/dhcp/settings)
+eval $(/usr/local/bin/readhash /var/ipfire/ppp/settings)
+eval $(/usr/local/bin/readhash /var/ipfire/vpn/settings)
 
 # This is a small wrapper for dhcpcd.exe
 if ( echo $0 | /bin/grep -q 'dhcpcd.exe' ); then
index 44201a385ac3e8415c5933357d02a09942b29cc8..ca05abf753f09f59c7b60fc647497ad215598d8a 100644 (file)
@@ -19,7 +19,7 @@
 ALLOW_MULTICAST=no
 
 # configuration
-. /var/ipfire/upnp/settings
+eval $(/usr/local/bin/readhash /var/ipfire/upnp/settings)
 
 case "$1" in
        start)