From 153b870be80fff4fa944c34aa7875c6de35f323d Mon Sep 17 00:00:00 2001 From: Daniel Glanzmann Date: Wed, 1 Oct 2008 14:58:59 +0200 Subject: [PATCH 01/10] added some vim syntax files --- config/rootfiles/common/vim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/rootfiles/common/vim b/config/rootfiles/common/vim index 7f22403d0..36f187c97 100644 --- a/config/rootfiles/common/vim +++ b/config/rootfiles/common/vim @@ -617,7 +617,7 @@ usr/bin/vim #usr/share/vim/vim70/syntax/blank.vim #usr/share/vim/vim70/syntax/bst.vim #usr/share/vim/vim70/syntax/btm.vim -#usr/share/vim/vim70/syntax/c.vim +usr/share/vim/vim70/syntax/c.vim #usr/share/vim/vim70/syntax/calendar.vim #usr/share/vim/vim70/syntax/catalog.vim #usr/share/vim/vim70/syntax/cdl.vim @@ -667,7 +667,7 @@ usr/bin/vim #usr/share/vim/vim70/syntax/desktop.vim #usr/share/vim/vim70/syntax/dictconf.vim #usr/share/vim/vim70/syntax/dictdconf.vim -#usr/share/vim/vim70/syntax/diff.vim +usr/share/vim/vim70/syntax/diff.vim #usr/share/vim/vim70/syntax/dircolors.vim #usr/share/vim/vim70/syntax/diva.vim #usr/share/vim/vim70/syntax/django.vim @@ -712,7 +712,7 @@ usr/bin/vim #usr/share/vim/vim70/syntax/forth.vim #usr/share/vim/vim70/syntax/fortran.vim #usr/share/vim/vim70/syntax/foxpro.vim -#usr/share/vim/vim70/syntax/fstab.vim +usr/share/vim/vim70/syntax/fstab.vim #usr/share/vim/vim70/syntax/fvwm.vim #usr/share/vim/vim70/syntax/fvwm2m4.vim #usr/share/vim/vim70/syntax/gdb.vim @@ -856,7 +856,7 @@ usr/bin/vim #usr/share/vim/vim70/syntax/passwd.vim #usr/share/vim/vim70/syntax/pcap.vim #usr/share/vim/vim70/syntax/pccts.vim -#usr/share/vim/vim70/syntax/perl.vim +usr/share/vim/vim70/syntax/perl.vim #usr/share/vim/vim70/syntax/pf.vim #usr/share/vim/vim70/syntax/pfmain.vim #usr/share/vim/vim70/syntax/php.vim @@ -886,7 +886,7 @@ usr/bin/vim #usr/share/vim/vim70/syntax/ptcap.vim #usr/share/vim/vim70/syntax/purifylog.vim #usr/share/vim/vim70/syntax/pyrex.vim -#usr/share/vim/vim70/syntax/python.vim +usr/share/vim/vim70/syntax/python.vim #usr/share/vim/vim70/syntax/qf.vim #usr/share/vim/vim70/syntax/quake.vim #usr/share/vim/vim70/syntax/r.vim @@ -927,7 +927,7 @@ usr/bin/vim #usr/share/vim/vim70/syntax/sgml.vim #usr/share/vim/vim70/syntax/sgmldecl.vim #usr/share/vim/vim70/syntax/sgmllnx.vim -#usr/share/vim/vim70/syntax/sh.vim +usr/share/vim/vim70/syntax/sh.vim #usr/share/vim/vim70/syntax/sicad.vim #usr/share/vim/vim70/syntax/sieve.vim #usr/share/vim/vim70/syntax/simula.vim @@ -973,12 +973,12 @@ usr/bin/vim #usr/share/vim/vim70/syntax/st.vim #usr/share/vim/vim70/syntax/stata.vim #usr/share/vim/vim70/syntax/stp.vim -#usr/share/vim/vim70/syntax/strace.vim +usr/share/vim/vim70/syntax/strace.vim #usr/share/vim/vim70/syntax/sudoers.vim #usr/share/vim/vim70/syntax/svn.vim #usr/share/vim/vim70/syntax/syncolor.vim #usr/share/vim/vim70/syntax/synload.vim -#usr/share/vim/vim70/syntax/syntax.vim +usr/share/vim/vim70/syntax/syntax.vim #usr/share/vim/vim70/syntax/sysctl.vim #usr/share/vim/vim70/syntax/tads.vim #usr/share/vim/vim70/syntax/tags.vim From 9428960b88e9ca6c8dd492e3cfa16cedc3f31e1d Mon Sep 17 00:00:00 2001 From: Daniel Glanzmann Date: Wed, 1 Oct 2008 14:59:34 +0200 Subject: [PATCH 02/10] added unattended option to isolinux --- config/syslinux/options.msg | 2 +- config/syslinux/syslinux.cfg | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/syslinux/options.msg b/config/syslinux/options.msg index d1a977d4f..54d6e0836 100644 --- a/config/syslinux/options.msg +++ b/config/syslinux/options.msg @@ -9,7 +9,7 @@ - To test the memory in your system type: 04memtest 07. - + - To install in unattended mode, type: unattended . diff --git a/config/syslinux/syslinux.cfg b/config/syslinux/syslinux.cfg index 0aa1ec06d..15af66e4a 100644 --- a/config/syslinux/syslinux.cfg +++ b/config/syslinux/syslinux.cfg @@ -11,6 +11,9 @@ LABEL novga LABEL dma KERNEL vmlinuz APPEND initrd=instroot root=/dev/ram0 ramdisk_size=16384 vga=791 splash=silent ro +LABEL unattended + KERNEL vmlinuz + APPEND ide=nodma initrd=instroot root=/dev/ram0 ramdisk_size=16384 vga=791 splash=silent unattended ro LABEL memtest KERNEL memtest APPEND - From fba21bd52c40df4467355edabc4253674e6c8f1b Mon Sep 17 00:00:00 2001 From: Daniel Glanzmann Date: Wed, 1 Oct 2008 15:00:13 +0200 Subject: [PATCH 03/10] fix some settings for unattended install --- config/syslinux/unattended.conf | 1 - src/install+setup/install/unattended.c | 2 +- src/scripts/backupiso | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config/syslinux/unattended.conf b/config/syslinux/unattended.conf index 39f6bca25..5adf27900 100644 --- a/config/syslinux/unattended.conf +++ b/config/syslinux/unattended.conf @@ -10,4 +10,3 @@ GREEN_NETADDRESS=192.168.180.0 GREEN_BROADCAST=192.168.180.255 ROOT_PASSWORD=ipfire ADMIN_PASSWORD=ipfire -RESTORE_FILE= diff --git a/src/install+setup/install/unattended.c b/src/install+setup/install/unattended.c index 754946aa2..95ee6698e 100644 --- a/src/install+setup/install/unattended.c +++ b/src/install+setup/install/unattended.c @@ -150,7 +150,7 @@ int unattended_setup(struct keyvalue *unattendedkv) { if (strlen(restore_file) > 0) { fprintf(flog, "unattended: Restoring Backup\n"); snprintf(commandstring, STRING_SIZE, - "cd /harddisk && /bin/tar -xvz --preserve -f /harddisk/var/ipfire/%s", restore_file); + "cd /harddisk && /bin/tar -xvz --preserve -f /harddisk/var/ipfire/backup/%s", restore_file); if (mysystem(commandstring)) { errorbox("unattended: ERROR restoring backup"); } diff --git a/src/scripts/backupiso b/src/scripts/backupiso index 59f2e6705..d579e5098 100644 --- a/src/scripts/backupiso +++ b/src/scripts/backupiso @@ -3,7 +3,7 @@ # FIXME: edit this lines before release #URL=http://download.ipfire.org/iso/ #ISO=ipfire-2.3-beta4.i586-full.iso -URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20080930-11uhr/ +URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20081001-10uhr/ ISO=ipfire-2.3-test.i586-full.iso if [ -z "$1" ]; then From 37345842097ea83b8a41d6de7bba650848a73aa8 Mon Sep 17 00:00:00 2001 From: Daniel Glanzmann Date: Wed, 1 Oct 2008 15:00:31 +0200 Subject: [PATCH 04/10] added tar gzip support to busybox --- config/uClibc/busybox.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/uClibc/busybox.config b/config/uClibc/busybox.config index aa880abe7..dfe2a3003 100644 --- a/config/uClibc/busybox.config +++ b/config/uClibc/busybox.config @@ -88,7 +88,7 @@ CONFIG_TAR=y CONFIG_FEATURE_TAR_BZIP2=y # CONFIG_FEATURE_TAR_LZMA is not set # CONFIG_FEATURE_TAR_FROM is not set -# CONFIG_FEATURE_TAR_GZIP is not set +CONFIG_FEATURE_TAR_GZIP=y # CONFIG_FEATURE_TAR_COMPRESS is not set CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y From 2c6a4efbbb5b448ca91a54eb8b24de6f0fc4f1ab Mon Sep 17 00:00:00 2001 From: Maniacikarus Date: Wed, 1 Oct 2008 15:15:57 +0200 Subject: [PATCH 05/10] Fixed Control Char --- config/syslinux/options.msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/syslinux/options.msg b/config/syslinux/options.msg index 54d6e0836..a0b756b4b 100644 --- a/config/syslinux/options.msg +++ b/config/syslinux/options.msg @@ -9,7 +9,7 @@ - To test the memory in your system type: 04memtest 07. - - To install in unattended mode, type: unattended . + - To install in unattended mode, type: 04unattended 07. From 5468f10298ada324b7472d0e49bb09e615c6da5a Mon Sep 17 00:00:00 2001 From: Maniacikarus Date: Wed, 1 Oct 2008 15:18:04 +0200 Subject: [PATCH 06/10] Modified makegraphs --- src/scripts/makegraphs | 185 ++++++++++++++++++++--------------------- 1 file changed, 90 insertions(+), 95 deletions(-) diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index 5369ab9d9..f8cd865df 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -1,26 +1,24 @@ #!/usr/bin/perl -############################################################################ -# # -# This file is part of the IPCop Firewall. # -# # -# IPCop is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# IPCop is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with IPCop; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -# Copyright (C) 2004-01-19 Mark Wormgoor . # -# # -############################################################################ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### use strict; #use warnings; @@ -40,97 +38,94 @@ my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); -sub updatehdddata -{ - my $disk = $_[0]; - my $standby; - my @array = split(/\//,$disk); +sub updatehdddata{ + my $disk = $_[0]; + my $standby; + my @array = split(/\//,$disk); - if ( ! -e "$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd"){ - # database did not exist -> create - RRDs::create ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "--step=300", - "DS:standby:GAUGE:600:0:1", - "RRA:AVERAGE:0.5:1:576", - "RRA:AVERAGE:0.5:6:672", - "RRA:AVERAGE:0.5:24:732", - "RRA:AVERAGE:0.5:144:1460"); - $ERROR = RRDs::error; - print "Error in RRD::create for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR; - } + if ( ! -e "$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd"){ + # database did not exist -> create + RRDs::create ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "--step=300", + "DS:standby:GAUGE:600:0:1", + "RRA:AVERAGE:0.5:1:576", + "RRA:AVERAGE:0.5:6:672", + "RRA:AVERAGE:0.5:24:732", + "RRA:AVERAGE:0.5:144:1460"); + $ERROR = RRDs::error; + print "Error in RRD::create for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR; + } - if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;} - else {$standby = 0;} + if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;} + else {$standby = 0;} - RRDs::update ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby"); - $ERROR = RRDs::error; - print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR; + RRDs::update ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby"); + $ERROR = RRDs::error; + print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR; - if ( ! -e "$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd"){ - # database did not exist -> create - RRDs::create ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "--step=300", - "DS:temperature:GAUGE:600:0:100", - "RRA:AVERAGE:0.5:1:576", - "RRA:AVERAGE:0.5:6:672", - "RRA:AVERAGE:0.5:24:732", - "RRA:AVERAGE:0.5:144:1460"); - $ERROR = RRDs::error; - print "Error in RRD::create for hdd-".$array[$#array].": $ERROR\n" if $ERROR; - } + if ( ! -e "$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd"){ + # database did not exist -> create + RRDs::create ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "--step=300", + "DS:temperature:GAUGE:600:0:100", + "RRA:AVERAGE:0.5:1:576", + "RRA:AVERAGE:0.5:6:672", + "RRA:AVERAGE:0.5:24:732", + "RRA:AVERAGE:0.5:144:1460"); + $ERROR = RRDs::error; + print "Error in RRD::create for hdd-".$array[$#array].": $ERROR\n" if $ERROR; + } - # Temperaturlesen w�rde die Platte aufwecken!!! - if (!$standby){ - $temp = 0; - my $smart_output = ''; - system("$path_smartctl -iHA -d ata /dev/$disk > /var/log/smartctl_out_hddtemp-$disk"); - if ( -e "/var/log/smartctl_out_hddtemp-".$array[$#array] ){ - my $hdd_output = `cat /var/log/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`; - my @t = split(/\s+/,$hdd_output); - $temp = $t[9]; - }else{$temp = 0;} - print "Temperature for ".$array[$#array]."->".$temp."<-\n"; - # Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht) - if ($temp){ - RRDs::update ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp"); - $ERROR = RRDs::error; - print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR; - } - } + # Temperaturlesen w�rde die Platte aufwecken!!! + if (!$standby){ + $temp = 0; + my $smart_output = ''; + system("$path_smartctl -iHA -d ata /dev/$disk > /tmp/smartctl_out_hddtemp-$disk"); + if ( -e "/tmp/smartctl_out_hddtemp-".$array[$#array] ){ + my $hdd_output = `cat /tmp/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`; + my @t = split(/\s+/,$hdd_output); + $temp = $t[9]; + }else{$temp = 0;} + print "Temperature for ".$array[$#array]."->".$temp."<-\n"; + # Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht) + if ($temp){ + RRDs::update ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp"); + $ERROR = RRDs::error; + print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR; + } + } } -## Update ipac logs -#system ('/usr/sbin/fetchipac'); ## Update vnstat system ('/usr/bin/vnstat -u'); my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`; system("unlink /tmp/hddstatus && touch /tmp/hddstatus"); foreach (@disks){ - my $disk = $_; - chomp $disk; - print "Working on disk ".$disk.".\n"; + my $disk = $_; + chomp $disk; + print "Working on disk ".$disk.".\n"; - my $status = ""; - my $diskstats = ""; - my $newdiskstats = ""; - my @array = split(/\//,$disk); + my $status = ""; + my $diskstats = ""; + my $newdiskstats = ""; + my @array = split(/\//,$disk); - $diskstats = `cat /tmp/hddstats-$array[$#array]`; - chomp $diskstats; - my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`; - chomp $newdiskstats; - my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`; - chomp $status; + $diskstats = `cat /tmp/hddstats-$array[$#array]`; + chomp $diskstats; + my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`; + chomp $newdiskstats; + my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`; + chomp $status; - if ($status !~/standby/ || $diskstats ne $newdiskstats){ - if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);} - } + if ($status !~/standby/ || $diskstats ne $newdiskstats){ + if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);} + } - if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";} - else{$status = " active\n";} + if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";} + else{$status = " active\n";} - open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden"; - print DATEI $disk."-".$status; - close(DATEI); + open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden"; + print DATEI $disk."-".$status; + close(DATEI); - updatehdddata($disk); + updatehdddata($disk); } From 19e44e3e440fe76dd0270ee50816fb0bb3d13d69 Mon Sep 17 00:00:00 2001 From: Maniacikarus Date: Wed, 1 Oct 2008 15:18:41 +0200 Subject: [PATCH 07/10] Upgraded lm_sensors to detect more hardware --- config/rootfiles/common/lm_sensors | 2 +- lfs/lm_sensors | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/rootfiles/common/lm_sensors b/config/rootfiles/common/lm_sensors index 1c6ed6574..99fc39b8d 100644 --- a/config/rootfiles/common/lm_sensors +++ b/config/rootfiles/common/lm_sensors @@ -16,7 +16,7 @@ usr/lib/libsensors.so.4.0.2 #usr/man/man8/isadump.8 #usr/man/man8/isaset.8 #usr/man/man8/pwmconfig.8 -#usr/local/man/man8/sensors-detect.8 +#usr/man/man8/sensors-detect.8 usr/sbin/fancontrol usr/sbin/isadump usr/sbin/isaset diff --git a/lfs/lm_sensors b/lfs/lm_sensors index cf73c79e6..cab054e8d 100644 --- a/lfs/lm_sensors +++ b/lfs/lm_sensors @@ -24,7 +24,7 @@ include Config -VER = 3.0.2 +VER = 3.0.3 THISAPP = lm_sensors-$(VER) DL_FILE = $(THISAPP).tar.bz2 @@ -40,7 +40,7 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_MD5 = 5b210ba9cc01f00161c438fd618484e5 +$(DL_FILE)_MD5 = e88b236228ac2a50821217015b8fd0fa install : $(TARGET) From 20f92a61f5d2a70a3eb2be27f6510c4a76848f9c Mon Sep 17 00:00:00 2001 From: Maniacikarus Date: Wed, 1 Oct 2008 15:31:59 +0200 Subject: [PATCH 08/10] Change collectd backup period to one a day Changed hddshutdown to half an hour --- config/cron/crontab | 4 ++-- config/rootfiles/updater/update.sh | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/cron/crontab b/config/cron/crontab index 004369b1a..2d7552bed 100644 --- a/config/cron/crontab +++ b/config/cron/crontab @@ -22,7 +22,7 @@ HOME=/ # Make some nice graphs */5 * * * * /usr/local/bin/makegraphs >/dev/null -01 * * * * /etc/init.d/collectd backup >/dev/null +* 05 * * * /etc/init.d/collectd backup >/dev/null # Force update the dynamic dns registration once a week # Force update even if IP has not changed once a month if 'minimize update' selected in GUI @@ -37,7 +37,7 @@ HOME=/ find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=56} -exec rm -f '{}' ';' # hddshutdown -02 * * * * /usr/local/bin/hddshutdown >/dev/null +*/30 * * * * /usr/local/bin/hddshutdown >/dev/null # connection-scheduler */5 * * * * /usr/local/bin/connscheduler timer > /dev/null diff --git a/config/rootfiles/updater/update.sh b/config/rootfiles/updater/update.sh index 18593dcde..582a59890 100755 --- a/config/rootfiles/updater/update.sh +++ b/config/rootfiles/updater/update.sh @@ -171,9 +171,11 @@ echo \\n running on \\s \\r \\m >> /etc/issue # # Update crontab # -grep -v "ipacsum" /var/spool/cron/root.orig > /tmp/root.orig.tmp +grep -v "ipacsum" /var/spool/cron/root.orig | grep -v "hddshutdown" > /tmp/root.orig.tmp echo "# Backup collectd files" >> /tmp/root.orig.tmp -echo "01 * * * * /etc/init.d/collectd backup >/dev/null" >> /tmp/root.orig.tmp +echo "* 05 * * * /etc/init.d/collectd backup >/dev/null" >> /tmp/root.orig.tmp +echo "# hddshutdown" >> /tmp/root.orig.tmp +echo "*/30 * * * * /usr/local/bin/hddshutdown >/dev/null" >> /tmp/root.orig.tmp mv /tmp/root.orig.tmp /var/spool/cron/root.orig chmod 600 /var/spool/cron/root.orig chown root:cron /var/spool/cron/root.orig From b90a7e56feed1e4dbe7c2909809e4e4a8422fdc6 Mon Sep 17 00:00:00 2001 From: Daniel Glanzmann Date: Wed, 1 Oct 2008 15:43:22 +0200 Subject: [PATCH 09/10] added option to download and delete iso backup --- config/backup/backup.pl | 3 +++ html/cgi-bin/backup.cgi | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index 5633569fd..e67a958f4 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -76,6 +76,9 @@ elsif ($ARGV[0] eq 'addonbackup') { elsif ($ARGV[0] =~ /ipf$/ ) { system("rm /var/ipfire/backup/$ARGV[0]"); } +elsif ($ARGV[0] =~ /iso$/ ) { + system("rm /var/tmp/backupiso/$ARGV[0]"); +} elsif ($ARGV[0] eq '') { printf "No argument given, please use \n" } diff --git a/html/cgi-bin/backup.cgi b/html/cgi-bin/backup.cgi index 0592ef82c..eacfd789b 100644 --- a/html/cgi-bin/backup.cgi +++ b/html/cgi-bin/backup.cgi @@ -56,6 +56,8 @@ system("/usr/local/bin/backupctrl makedirs >/dev/null 2>&1 ") unless ( -e '/var/ ############################################################################################################################ ############################################## System calls ohne Http Header ############################################### +# Replace slashes from filename +$cgiparams{'FILE'} =~ s/\///; if ( $cgiparams{'ACTION'} eq "download" ) { @@ -66,6 +68,15 @@ if ( $cgiparams{'ACTION'} eq "download" ) print @fileholder; exit (0); } +if ( $cgiparams{'ACTION'} eq "downloadiso" ) +{ + open(DLFILE, "; + print "Content-Type:application/x-download\n"; + print "Content-Disposition:attachment;filename=$cgiparams{'FILE'}\n\n"; + print @fileholder; + exit (0); +} if ( $cgiparams{'ACTION'} eq "downloadaddon" ) { open(DLFILE, "/dev/null`; +my @backupisos = `cd /var/tmp/backupiso/ && ls *.iso 2>/dev/null`; &Header::openbox('100%', 'center', $Lang::tr{'backup'}); @@ -182,6 +194,15 @@ $Size = sprintf("%02d", $Size); print "$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB
"; print "
"; } +foreach (@backupisos){ +chomp($_); +my $Datei = "/var/tmp/backupiso/".$_; +my @Info = stat($Datei); +my $Size = $Info[7] / 1024; +$Size = sprintf("%02d", $Size); +print "$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB
"; +print "
"; +} print < END From dbe2ef8b42d38308e1d1dec07528ac02d29aeb4a Mon Sep 17 00:00:00 2001 From: Daniel Glanzmann Date: Wed, 1 Oct 2008 18:22:26 +0200 Subject: [PATCH 10/10] updated iso url in backupiso --- src/scripts/backupiso | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/backupiso b/src/scripts/backupiso index d579e5098..6be63bf0e 100644 --- a/src/scripts/backupiso +++ b/src/scripts/backupiso @@ -3,7 +3,7 @@ # FIXME: edit this lines before release #URL=http://download.ipfire.org/iso/ #ISO=ipfire-2.3-beta4.i586-full.iso -URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20081001-10uhr/ +URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20081001-17uhr/ ISO=ipfire-2.3-test.i586-full.iso if [ -z "$1" ]; then