Korrekturen damit der Build wieder laeuft
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Tue, 16 Oct 2007 18:35:15 +0000 (18:35 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Tue, 16 Oct 2007 18:35:15 +0000 (18:35 +0000)
MPFire fix damit der shuffle funktioniert
Backup der Addons weiter gebaut

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

20 files changed:
config/backup/backup.pl
config/mpfire/mpfire.pl
config/rootfiles/packages/mpfire
config/rootfiles/packages/samba
doc/packages-list.txt
html/cgi-bin/backup.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/backup
lfs/mpfire
lfs/samba
make.sh
src/pakfire/lib/functions.sh
src/paks/default/install.sh
src/paks/default/uninstall.sh
src/paks/default/update.sh
src/paks/mpfire/install.sh
src/paks/mpfire/uninstall.sh
src/paks/mpfire/update.sh
tools/make-functions

index a9d7a1f..ff9eea5 100644 (file)
@@ -60,6 +60,9 @@ elsif ($ARGV[0] eq 'exclude') {
 elsif ($ARGV[0] eq 'restore') {
   system("cd / && tar -xvz --preserve -f /tmp/restore.ipf");
 }
+elsif ($ARGV[0] eq 'restoreaddon') {
+  system("cd / && tar -xvz --preserve -f /var/ipfire/backup/addons/backup/$ARGV[1].ipf");
+}
 elsif ($ARGV[0] eq 'cli') {
   system("tar -cvzf /var/ipfire/backup/$Jahr$Monat$Monatstag-$Stunden$Minuten-$ARGV[1].ipf --files-from='$ARGV[2]' --exclude-from='$ARGV[3]'");
 }
index 78d1aec..e72b2fc 100644 (file)
@@ -90,7 +90,7 @@ sub clearplaylist(){
   }
 
 sub shuffle(){
-  system("mpc shuffle >/dev/null");  
+  system("mpc random >/dev/null");  
   }
 
 sub checkplaylist(){
index 44b12b9..dc0ba42 100644 (file)
@@ -1,5 +1,6 @@
 usr/local/bin/mpfirectrl
 srv/web/ipfire/cgi-bin/mpfire.cgi
+var/ipfire/backup/addons/include/mpfire
 var/ipfire/menu.d/EX-mpfire.menu
 var/ipfire/mpfire
 var/ipfire/mpfire/bin
index 6a09a92..35bc24b 100644 (file)
@@ -574,6 +574,7 @@ usr/sbin/winbindd
 #usr/share/samba/swat/using_samba/samba2_s.gif
 #usr/share/samba/swat/using_samba/samba2_xs.gif
 #usr/share/samba/swat/using_samba/toc.html
+var/ipfire/backup/addons/include/samba
 #var/ipfire/samba
 var/ipfire/samba/default.global
 var/ipfire/samba/default.pdc
index a33d4a0..1e89c96 100644 (file)
@@ -1,4 +1,4 @@
-== List of softwares used to build IPFire Version: 2.0rc1 ==
+== List of softwares used to build IPFire Version: 2.0rc2t ==
 * Archive-Tar-1.29
 * Archive-Zip-1.16
 * BerkeleyDB-0.27
@@ -20,7 +20,6 @@
 * MIME-tools-5.420
 * Mail-SpamAssassin-3.1.3
 * MailTools-1.74
-* MoBlock-0.8
 * Net-DNS-0.47
 * Net-IPv4Addr-0.10
 * Net-Server-0.93
 * libwww-perl-5.803
 * libxml2-2.6.26
 * libxslt-1.1.17
-* linux-2.6.16.54
+* linux-2.6.16.55
 * linux-atm-2.4.1
 * linux-libc-headers-2.6.12.0
 * linuxigd-0.95
 * reiserfsprogs-3.6.19
 * rp-pppoe-3.8
 * rrdtool-1.2.15
-* rsync-2.6.8
+* rsync-2.6.9
 * rtorrent-0.7.6
 * samba-3.0.26a
 * screen-4.0.3
index 252f515..a0b2dcf 100644 (file)
@@ -21,8 +21,8 @@
 
 use strict;
 # enable only the following on debugging purpose
-use warnings;
-use CGI::Carp 'fatalsToBrowser';
+#use warnings;
+#use CGI::Carp 'fatalsToBrowser';
 use File::Copy;
 
 require '/var/ipfire/general-functions.pl';
@@ -61,6 +61,15 @@ if ( $cgiparams{'ACTION'} eq "download" )
                print @fileholder;
                exit (0);
 }
+if ( $cgiparams{'ACTION'} eq "downloadaddon" )
+{
+               open(DLFILE, "</var/ipfire/backup/addons/backup/$cgiparams{'FILE'}") or die "Unable to open $cgiparams{'FILE'}: $!";
+               my @fileholder = <DLFILE>;
+               print "Content-Type:application/x-download\n";
+               print "Content-Disposition:attachment;filename=$cgiparams{'FILE'}\n\n";
+               print @fileholder;
+               exit (0);
+}
 elsif ( $cgiparams{'ACTION'} eq "restore" )
 {
                my $upload = $a->param("UPLOAD");
@@ -72,6 +81,18 @@ elsif ( $cgiparams{'ACTION'} eq "restore" )
                close UPLOADFILE;
                system("/usr/local/bin/backupctrl restore >/dev/null 2>&1");
 }
+elsif ( $cgiparams{'ACTION'} eq "restoreaddon" )
+{
+               my $upload = $a->param("UPLOAD");
+               open UPLOADFILE, ">/var/$cgiparams{'UPLOAD'}";
+               binmode $upload;
+               while ( <$upload> ) {
+               print UPLOADFILE;
+               }
+               close UPLOADFILE;
+               system("cp /var/ipfire/backup/addons/backup/$cgiparams{'UPLOAD'} /tmp/restore.ipf >/dev/null 2>&1");
+               system("/usr/local/bin/backupctrl restore >/dev/null 2>&1");
+}
 
 &Header::showhttpheaders();
 
@@ -90,7 +111,7 @@ if ( $cgiparams{'ACTION'} eq "backup" )
 }
 if ( $cgiparams{'ACTION'} eq "addonbackup" )
 {
-       system("/usr/local/bin/backupctrl addonbackup $cgiparams{'ADDON'}");
+       system("/usr/local/bin/backupctrl addonbackup $cgiparams{'ADDON'} >/dev/null 2>&1");
 }
 elsif ( $cgiparams{'ACTION'} eq "delete" )
 {
@@ -151,19 +172,6 @@ END
 ;
 &Header::closebox();
 
-############################################################################################################################
-####################################### Backups des Systems wiederherstellen ###############################################
-
-&Header::openbox('100%', 'center', $Lang::tr{'restore'});
-
-print <<END
-<table width='95%' cellspacing='0'>
-<tr><td align='left'>$Lang::tr{'backup'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restore' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
-</table>
-END
-;
-&Header::closebox();
-
 ############################################################################################################################
 ############################################# Backups von Addons erstellen #################################################
 
@@ -183,8 +191,8 @@ print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Siz
 print <<END
        <td align='right' width='5'>
                <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-               <input type='hidden' name='ACTION' value='download' />
-               <input type='hidden' name='FILE' value='addons/backup/$_.ipf' />
+               <input type='hidden' name='ACTION' value='downloadaddon' />
+               <input type='hidden' name='FILE' value='$_.ipf' />
                <input type='image' alt='$Lang::tr{'download'}' title='$Lang::tr{'download'}' src='/images/package-x-generic.png' />
                </form>
        </td>
@@ -214,5 +222,20 @@ END
 }
 print "</table>";
 &Header::closebox();
+
+############################################################################################################################
+####################################### Backups des Systems wiederherstellen ###############################################
+
+&Header::openbox('100%', 'center', $Lang::tr{'restore'});
+
+print <<END
+<table width='95%' cellspacing='0'>
+<tr><td align='center' colspan='2'><font color='red'><br />$Lang::tr{'backupwarning'}</font><br /><br /></td></tr>
+<tr><td align='left'>$Lang::tr{'backup'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restore' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
+<tr><td align='left'>$Lang::tr{'backupaddon'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restoreaddon' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
+</table>
+END
+;
+&Header::closebox();
 &Header::closebigbox();
 &Header::closepage();
index 1640fad..015efd0 100644 (file)
 'backup password' => 'Datensicherungs-Passwort',
 'backup sets' => 'Datensicherungssätze',
 'backup to floppy' => 'Datensicherung auf Diskette',
+'backupaddon' => 'Addonsicherung',
 'backupprofile' => 'Falls die Wiederverbindung scheitert, auf Profil umschalten',
 'backups' => 'Sicherungen',
+'backupwarning' => 'Bitte stellen Sie zuerst Ihre Hauptsicherung wieder her und anschließend die Addons. Achten Sie darauf, dass die Sicherungen ihre orginal Dateinamen behalten.',
 'bad characters in' => 'Ungültige Zeichen in ',
 'bad characters in script field' => 'Nicht erlaubte Zeichen im Skriptnamen',
 'bad characters in the telephone number field' => 'Nicht erlaubte(s) Zeichen im Feld Telefonnummer.',
index a5a0d07..6fad42a 100644 (file)
 'backup protect key password' => 'Backup key password',
 'backup sets' => 'Backup Sets',
 'backup to floppy' => 'Backup to floppy',
+'backupaddon' => 'Addon Backup',
 'backupprofile' => 'In case reconnection fails, switch to profile',
 'backups' => 'backups',
+'backupwarning' => 'Please first restore your main backup and after this your addon backups. Please keep the original filename, given when you download.',
 'bad characters in' => 'Bad characters in ',
 'bad characters in script field' => 'Bad characters in script field',
 'bad characters in the telephone number field' => 'Bad characters in the telephone number field.',
index 12e958e..d11e7ea 100644 (file)
@@ -60,4 +60,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        install -v -m 644 $(DIR_SRC)/config/backup/include /var/ipfire/backup/
        install -v -m 644 $(DIR_SRC)/config/backup/exclude /var/ipfire/backup/
        chown nobody:nobody -R /var/ipfire/backup/
+       -mkdir -p /var/ipfire/backup/addons
+       -mkdir -p /var/ipfire/backup/addons/include
+       -mkdir -p /var/ipfire/backup/addons/backup
        @$(POSTBUILD)
index c38128a..b108a64 100644 (file)
@@ -67,4 +67,5 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        chown nobody.nobody /var/ipfire/mpfire/{settings,webradio}
        chown root.nobody /var/ipfire/mpfire/db/mpd.db
        chmod 664 /var/ipfire/mpfire/playlist.m3u
+       install -v -m 644 $(DIR_SRC)/config/backup/includes/mpfire /var/ipfire/backup/addons/includes/mpfire
        @$(POSTBUILD)
index 95fd2e5..07aa530 100644 (file)
--- a/lfs/samba
+++ b/lfs/samba
@@ -107,5 +107,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        cp -vfp /var/ipfire/samba/default.printer /var/ipfire/samba/printer
        cat /var/ipfire/samba/global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf
        -mkdir -p /var/log/samba
+       install -v -m 644 $(DIR_SRC)/config/backup/includes/samba /var/ipfire/backup/addons/includes/samba
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/make.sh b/make.sh
index 406326f..c42cc82 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -394,7 +394,6 @@ buildipfire() {
   ipfiremake iptables
   ipfiremake libupnp
   ipfiremake ipp2p                     IPT=1
-  ipfiremake moblock
   ipfiremake linux-igd
   ipfiremake ipac-ng
   ipfiremake ipaddr
@@ -473,7 +472,7 @@ buildipfire() {
   ipfiremake htop
   ipfiremake postfix
   ipfiremake fetchmail
-  ipfiremake cyrusimap
+  ipfiremake cyrus-imapd
   ipfiremake openmailadmin
   ipfiremake mailx
   ipfiremake clamav
index 6fa682e..1c4e760 100644 (file)
@@ -36,6 +36,20 @@ remove_files() {
        echo "...Finished."
 }
 
+make_backup(){
+               [ -e "/var/ipfire/backup/addons/include/${1}" ] && \
+               ( echo "Creating Backup..."
+                       /usr/local/bin/backupctrl addonbackup ${1}
+                       echo "...Finished." )
+}
+
+restore_backup(){
+               [ -e "/var/ipfire/backup/addons/backup/${1}" ] && \
+               ( echo "Restoring Backup..." && \
+                       /usr/local/bin/backupctrl restoreaddon ${1} && \
+                       echo "...Finished." )
+}
+
 restart_service() {
        
        /etc/init.d/$1 restart
index 14973a9..d7f4405 100644 (file)
@@ -2,5 +2,6 @@
 . /opt/pakfire/lib/functions.sh
 
 extract_files
+restore_backup ${NAME}
 
 start_service --delay 60 --background ${NAME}
index c12adf9..2ce2019 100644 (file)
@@ -2,3 +2,4 @@
 . /opt/pakfire/lib/functions.sh
 
 stop_service ${NAME}
+make_backup ${NAME}
index a47a783..ba3239d 100644 (file)
@@ -1,4 +1,6 @@
 #!/bin/bash
 . /opt/pakfire/lib/functions.sh
 
+make_backup ${NAME}
 extract_files
+restore_backup ${NAME}
index f5aefa4..1b8e1df 100644 (file)
@@ -9,3 +9,4 @@ ln -svf  /etc/init.d/mpd /etc/rc.d/rc6.d/K35mpd
 ln -svf  /var/ipfire/mpfire/mpd.conf /etc/mpd.conf
 touch /var/log/mpd.error.log
 touch /var/log/mpd.log
+restore_backup mpfire
index e69de29..28dcea5 100644 (file)
@@ -0,0 +1,4 @@
+#!/bin/bash
+. /opt/pakfire/lib/functions.sh
+
+make_backup mpfire
index e69de29..82a5403 100644 (file)
@@ -0,0 +1,5 @@
+#!/bin/bash
+. /opt/pakfire/lib/functions.sh
+
+make_backup mpfire
+restore_backup mpfire
index c8b63e7..62f3311 100644 (file)
@@ -560,6 +560,7 @@ END
                ;;
        esac
 
+sleep 15
        python tools/sendEmail < /tmp/ipfire_mail_body.$$
        if [ "$?" -eq "0" ]; then
                beautify message DONE