Hinzugefügt:
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Wed, 14 Jun 2006 10:10:01 +0000 (10:10 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Wed, 14 Jun 2006 10:10:01 +0000 (10:10 +0000)
  * qos.cgi - Geht noch so gut wie nix.
Geändert:
  * hddshutdown funktioniert nun.

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

doc/packages-to-remove-from-ftp
html/cgi-bin/qos.cgi [new file with mode: 0644]
lfs/Config
lfs/configroot
src/ROOTFILES.i386
src/rc.d/rc.sysinit
src/scripts/hddshutdown

diff --git a/html/cgi-bin/qos.cgi b/html/cgi-bin/qos.cgi
new file mode 100644 (file)
index 0000000..ecda291
--- /dev/null
@@ -0,0 +1,166 @@
+#!/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 %qossettings=();
+my %checked=();
+my %netsettings=();
+my $errormessage = "";
+&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+
+&Header::showhttpheaders();
+
+$qossettings{'ACTION'} = '';
+$qossettings{'ACTION_BW'} = '';
+$qossettings{'ENABLED'} = '';
+$qossettings{'OUT_SPD'} = '';
+$qossettings{'INC_SPD'} = '';
+$qossettings{'RED_DEV'} = `cat /var/ipfire/red/iface`;
+$qossettings{'IMQ_DEV'} = 'imq0';
+
+&General::readhash("${General::swroot}/qos/settings", \%qossettings);
+&Header::getcgihash(\%qossettings);
+
+&Header::openpage('QoS', 1, '');
+
+&Header::openbigbox('100%', 'left', '', $errormessage);
+
+
+if ($qossettings{'ACTION'} eq 'Start')
+{
+       system("/bin/touch /var/ipfire/qos/enable");
+       $qossettings{'ENABLED'} = 'on';
+       &General::writehash("${General::swroot}/qos/settings", \%qossettings);
+}
+elsif ($qossettings{'ACTION'} eq 'Stop')
+{
+       unlink "/var/ipfire/qos/enable";
+       $qossettings{'ENABLED'} = 'off';
+       &General::writehash("${General::swroot}/qos/settings", \%qossettings);
+}
+elsif ($qossettings{'ACTION'} eq $Lang::tr{'save'})
+{
+       &General::writehash("${General::swroot}/qos/settings", \%qossettings);
+}
+if ($qossettings{'ACTION_BW'} eq 'Andern')
+{
+       &Header::openbox('100%', 'center', 'Bandbreiteneinstellungen');
+       if ($qossettings{'ENABLED'} eq 'on') {
+       print "Sie koennen die Bandbreiteneinstellungen nicht bearbeiten, wenn QoS eingeschaltet ist. Schalten sie es zuerst dazu aus.<p>";
+       print "<a href='/cgi-bin/qos.cgi'>Zurueck</a>";
+       } else {
+       print <<END
+       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+       <table width='66%'>
+       <tr><td width='100%' colspan='3'>Geben Sie bitte hier ihre Download- bzw. Upload-Geschwindigkeit ein <br> und klicken Sie danach auf <i>Speichern</i>.
+       <tr><td width='33%' align='right'>Download-Geschwindigkeit:<td width='33%' align='left'><input type='text' name='INC_SPD' maxlength='8' value=$qossettings{'INC_SPD'}> &nbsp; kbps<td width='33%' align='center'>&nbsp;
+       <tr><td width='33%' align='right'>Upload-Geschwindigkeit:<td width='33%' align='left'><input type='text' name='OUT_SPD' maxlength='8'value=$qossettings{'OUT_SPD'}> &nbsp; kbps<td width='33%' align='center'><input type='submit' name='ACTION' value=$Lang::tr{'save'} />
+       </table>
+       </form>
+END
+;
+       }
+       &Header::closebox();
+       &Header::closebigbox();
+       &Header::closepage();
+       exit
+}
+
+&General::readhash("${General::swroot}/qos/settings", \%qossettings);
+
+my $status = $Lang::tr{'stopped'};
+my $statuscolor = $Header::colourred;
+if ( $qossettings{'ENABLED'} eq 'on' ) {
+  $status = $Lang::tr{'running'};
+  $statuscolor = $Header::colourgreen;
+}
+
+if ( $netsettings{'RED_TYPE'} ne 'PPPOE' ) {
+       $qossettings{'RED_DEV'} = $netsettings{'RED_DEV'};
+}
+
+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%', 'center', 'Quality of Service');
+print <<END
+       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+       <table width='33%'>
+               <tr><td width='50%' align='left'><b>Quality of Service:</b>
+                   <td width='50%' align='center' bgcolor='$statuscolor'><font color='white'>$status</font>
+               <tr><td width='100%' align='center' 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'}' />
+END
+;
+       if (($qossettings{'OUT_SPD'} ne '') && ($qossettings{'INC_SPD'} ne '')) {
+               print <<END
+               <tr><td colspan='3'>&nbsp;
+               <tr><td width='40%' align='right'>Downloadgeschwindigkeit:      <td width='40%' align='left'>$qossettings{'INC_SPD'}    <td width='20%' rowspan='2' align='center' valign='middle'><input type='submit' name='ACTION_BW' value='Andern'>
+               <tr><td width='40%' align='right'>Uploadgeschwindigkeit:        <td width='40%' align='left'>$qossettings{'OUT_SPD'}
+
+END
+;
+       }
+print "</table>";
+&Header::closebox();
+
+if ( ($qossettings{'OUT_SPD'} eq '') || ($qossettings{'INC_SPD'} eq '') ) {
+&Header::openbox('100%', 'center', "Outgoing ($qossettings{'RED_DEV'})");
+print <<END
+       <table width='66%'>
+       <tr><td width='100%' colspan='3'>Geben Sie bitte hier ihre Download- bzw. Upload-Geschwindigkeit ein <br> und klicken Sie danach auf <i>Speichern</i>.
+       <tr><td width='33%' align='right'>Download-Geschwindigkeit:<td width='33%' align='left'><input type='text' name='INC_SPD' maxlength='8'> &nbsp; kbps<td width='33%' align='center'>&nbsp;
+       <tr><td width='33%' align='right'>Upload-Geschwindigkeit:<td width='33%' align='left'><input type='text' name='OUT_SPD' maxlength='8'> &nbsp; kbps<td width='33%' align='center'><input type='submit' name='ACTION' value=$Lang::tr{'save'} />
+       </table>
+       </form>
+END
+;
+&Header::closebox();
+&Header::closebigbox();
+&Header::closepage();
+exit
+}
+
+if ( $qossettings{'RED_DEV'} ne '' ) {
+       &Header::openbox('100%', 'center', 'Outgoing Interface');
+       print <<END
+       <table border='0' width='100%' cellspacing='0'>
+       <tr><td bgcolor='lightgrey' width='20%'>Interface<td bgcolor='lightgrey' width='20%'>Klasse<td bgcolor='lightgrey' width='20%'>Maximale Geschwindigkeit<td bgcolor='lightgrey' width='40%'>Aktionen
+       <tr><td bgcolor='black' height='2px' colspan='4'>
+       <tr><td>ppp0<td>198<td>512<td>BLA
+       <tr><td bgcolor='lightgrey'>ppp0<td bgcolor='lightgrey'>199<td bgcolor='lightgrey'>512<td bgcolor='lightgrey'>BLA
+       </table>
+END
+;
+       &Header::closebox();
+} else {
+       &Header::openbox('100%', 'center', 'Outgoing Interface');
+       print "Es ist kein rotes Interface vorhanden.";
+       &Header::closebox();
+       &Header::closebigbox();
+       &Header::closepage();
+       exit
+}
+
+&Header::closebigbox();
+&Header::closepage();
+
index 7f3cf2b..af89c7b 100644 (file)
@@ -142,8 +142,10 @@ define PAK
        tar --create -C / --files-from=/install/packages/package/ROOTFILES -f /packagetmp.tar --exclude='#*'
        tar -x -C /tmp -f /packagetmp.tar
        @rm -f /packagetmp.tar
-       @cd /tmp && tar zcf /install/packages/package/files.tgz * && rm -rf *
-       cd /install/packages/package && cat ROOTFILES | grep -v "#" > ROOTFILES && tar cfz ../$(THISAPP)-$(PAK_VER).tar.gz files.tgz install.sh uninstall.sh ROOTFILES
-       cd /install/packages && md5sum $(THISAPP)-$(PAK_VER).tar.gz > $(THISAPP)-$(PAK_VER).tar.gz.md5
+       @cd /tmp
+       tar zvcf /install/packages/package/files.tgz * -C /tmp
+       rm -rf /tmp/*
+       cd /install/packages/package && cat ROOTFILES | grep -v "#" > ROOTFILES && tar cfz ../$(PROG)-$(VER)-$(PAK_VER).tar.gz files.tgz install.sh uninstall.sh ROOTFILES
+       cd /install/packages && md5sum $(THISAPP)-$(PAK_VER).tar.gz > $(PROG)-$(VER)-$(PAK_VER).tar.gz.md5
        @rm -rf /install/packages/package
 endef
index 05ad310..f1c7b38 100644 (file)
@@ -52,7 +52,7 @@ $(TARGET) :
        # Create all directories
        for i in addon-lang alcatelusb auth backup backup/sets ca certs cnx_pci crls ddns dhcp dhcpc dmzholes \
            eagle-usb eciadsl ethernet isdn key langs logging main modem net-traffic nfs optionsfw patches pakfire portfw \
-           ppp private proxy/advanced red remote shaping snort time uplinks vpn wireless xtaccess ; do \
+           ppp private proxy/advanced qos red remote snort time uplinks vpn wireless xtaccess ; do \
                mkdir -p $(CONFIG_ROOT)/$$i; \
        done
 
@@ -62,8 +62,8 @@ $(TARGET) :
            dhcp/fixleases dhcp/advoptions dmzholes/config ethernet/aliases ethernet/settings \
            isdn/settings main/hosts main/settings optionsfw/settings pakfire/settings patches/available patches/installed \
            portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \
-           ppp/settings-5 ppp/settings proxy/settings remote/settings shaping/settings \
-           shaping/config snort/settings vpn/config vpn/settings vpn/ipsec.conf \
+           ppp/settings-5 ppp/settings proxy/settings remote/settings qos/settings \
+           snort/settings vpn/config vpn/settings vpn/ipsec.conf \
            vpn/ipsec.secrets vpn/caconfig wireless/config wireless/settings; do \
                touch $(CONFIG_ROOT)/$$i; \
        done
index 77d4a5b..05c4f0c 100644 (file)
@@ -1354,8 +1354,9 @@ tmp
 #usr/local
 #usr/local/bin
 usr/local/bin/httpscert
+usr/local/bin/hddshutdown
+usr/local/bin/hddshutdown-state
 usr/local/bin/makegraphs
-#usr/local/bin/make-packages.sh
 usr/local/bin/readhash
 usr/local/bin/setddns.pl
 usr/local/bin/setreservedports
@@ -21014,6 +21015,7 @@ home/httpd/cgi-bin/iptables.cgi
 home/httpd/cgi-bin/fwhits.cgi
 home/httpd/cgi-bin/ovpnfunc.pl
 home/httpd/cgi-bin/ovpnmain.cgi
+home/httpd/cgi-bin/qos.cgi
 #home/httpd/cgi-bin/logs.cgi
 home/httpd/cgi-bin/logs.cgi/config.dat
 home/httpd/cgi-bin/logs.cgi/firewalllog.dat
index 0062140..28b7c2c 100644 (file)
@@ -234,38 +234,26 @@ dmesg > /var/log/dmesg
 
 echo 7200 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established
 
-#if [ -e /var/log/rrd/disk.rrd ]; then
-#      echo "Adjusting graphs to compensate for boot"
-#      /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk.rrd","-t","readsect:writesect","N:U:U");'
-#fi
-#if [ -e /var/log/rrd/disk-hda.rrd ]; then
-#      /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hda.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'
-#fi
-#if [ -e /var/log/rrd/disk-hdb.rrd ]; then
-#      /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdb.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'
-#fi
-#if [ -e /var/log/rrd/disk-hdc.rrd ]; then
-#      /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdc.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'
-#fi
-#if [ -e /var/log/rrd/disk-hdd.rrd ]; then
-#      /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdd.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'
-#fi
-#if [ -e /var/log/rrd/disk-hde.rrd ]; then
-#      /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hde.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'
-#fi
-#if [ -e /var/log/rrd/disk-hdf.rrd ]; then
-#      /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdf.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'
-#fi
-#if [ -e /var/log/rrd/disk-hdg.rrd ]; then
-#      /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdg.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'
-#fi
-#if [ -e /var/log/rrd/disk-hdh.rrd ]; then
-#      /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdh.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'
-#fi
-#if [ -e /tmp/hddshutdown-stat ] ; then
-#  rm /tmp/hddshutdown-*"
-#fi
-#/usr/local/bin/hddshutdown
+if [ -e /var/log/rrd/disk.rrd ]; then echo "Adjusting graphs to compensate for boot"; \
+       /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk.rrd","-t","readsect:writesect","N:U:U");'; fi
+if [ -e /var/log/rrd/disk-hda.rrd ]; then \
+       /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hda.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
+if [ -e /var/log/rrd/disk-hdb.rrd ]; then \
+       /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdb.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
+if [ -e /var/log/rrd/disk-hdc.rrd ]; then \
+       /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdc.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
+if [ -e /var/log/rrd/disk-hdd.rrd ]; then \
+       /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdd.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
+if [ -e /var/log/rrd/disk-hde.rrd ]; then \
+       /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hde.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
+if [ -e /var/log/rrd/disk-hdf.rrd ]; then \
+       /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdf.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
+if [ -e /var/log/rrd/disk-hdg.rrd ]; then \
+       /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdg.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
+if [ -e /var/log/rrd/disk-hdh.rrd ]; then \
+       /usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdh.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
+rm -rf /tmp/hddshutdown-*
+/usr/local/bin/hddshutdown
 
 echo "Starting crond"
 /usr/sbin/fcron
@@ -280,7 +268,7 @@ echo "Starting sshd (if enabled)"
 echo "Starting ntpd (if enabled)"
 /usr/local/bin/restartntpd
 echo "Starting openvpn (if enabled)"
-/usr/local/bin/openvpnctrl --start-daemon-only
+/usr/local/bin/openvpnctrl --start-daemon-only >& /dev/null
 
 if [ -e "/var/ipfire/proxy/squid.conf" ]; then
        echo "Starting squid (if enabled)"
index ebd5257..f09f5b4 100644 (file)
@@ -70,7 +70,7 @@ sub shutdown_hdd {
                close (STAT);
                if (! ($lastsleepstate==$readwritereq)) { 
                        system("hdparm -y $hdddev");
-                       system("logger -t ipcop Shuting down $hdddev !");
+                       system("logger -t ipfire Shuting down $hdddev !");
                        system("echo $readwritereq > /tmp/hddshutdown-$hdd");
                }       
        }