Korrekturen damit der Build wieder laeuft

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
This commit is contained in:
ms
2007-10-16 18:35:15 +00:00
parent 901a50cfed
commit 5ad5a6bcd6
20 changed files with 89 additions and 25 deletions

View File

@@ -60,6 +60,9 @@ elsif ($ARGV[0] eq 'exclude') {
elsif ($ARGV[0] eq 'restore') { elsif ($ARGV[0] eq 'restore') {
system("cd / && tar -xvz --preserve -f /tmp/restore.ipf"); 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') { 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]'"); system("tar -cvzf /var/ipfire/backup/$Jahr$Monat$Monatstag-$Stunden$Minuten-$ARGV[1].ipf --files-from='$ARGV[2]' --exclude-from='$ARGV[3]'");
} }

View File

@@ -90,7 +90,7 @@ sub clearplaylist(){
} }
sub shuffle(){ sub shuffle(){
system("mpc shuffle >/dev/null"); system("mpc random >/dev/null");
} }
sub checkplaylist(){ sub checkplaylist(){

View File

@@ -1,5 +1,6 @@
usr/local/bin/mpfirectrl usr/local/bin/mpfirectrl
srv/web/ipfire/cgi-bin/mpfire.cgi srv/web/ipfire/cgi-bin/mpfire.cgi
var/ipfire/backup/addons/include/mpfire
var/ipfire/menu.d/EX-mpfire.menu var/ipfire/menu.d/EX-mpfire.menu
var/ipfire/mpfire var/ipfire/mpfire
var/ipfire/mpfire/bin var/ipfire/mpfire/bin

View File

@@ -574,6 +574,7 @@ usr/sbin/winbindd
#usr/share/samba/swat/using_samba/samba2_s.gif #usr/share/samba/swat/using_samba/samba2_s.gif
#usr/share/samba/swat/using_samba/samba2_xs.gif #usr/share/samba/swat/using_samba/samba2_xs.gif
#usr/share/samba/swat/using_samba/toc.html #usr/share/samba/swat/using_samba/toc.html
var/ipfire/backup/addons/include/samba
#var/ipfire/samba #var/ipfire/samba
var/ipfire/samba/default.global var/ipfire/samba/default.global
var/ipfire/samba/default.pdc var/ipfire/samba/default.pdc

View 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-Tar-1.29
* Archive-Zip-1.16 * Archive-Zip-1.16
* BerkeleyDB-0.27 * BerkeleyDB-0.27
@@ -20,7 +20,6 @@
* MIME-tools-5.420 * MIME-tools-5.420
* Mail-SpamAssassin-3.1.3 * Mail-SpamAssassin-3.1.3
* MailTools-1.74 * MailTools-1.74
* MoBlock-0.8
* Net-DNS-0.47 * Net-DNS-0.47
* Net-IPv4Addr-0.10 * Net-IPv4Addr-0.10
* Net-Server-0.93 * Net-Server-0.93
@@ -148,7 +147,7 @@
* libwww-perl-5.803 * libwww-perl-5.803
* libxml2-2.6.26 * libxml2-2.6.26
* libxslt-1.1.17 * libxslt-1.1.17
* linux-2.6.16.54 * linux-2.6.16.55
* linux-atm-2.4.1 * linux-atm-2.4.1
* linux-libc-headers-2.6.12.0 * linux-libc-headers-2.6.12.0
* linuxigd-0.95 * linuxigd-0.95
@@ -215,7 +214,7 @@
* reiserfsprogs-3.6.19 * reiserfsprogs-3.6.19
* rp-pppoe-3.8 * rp-pppoe-3.8
* rrdtool-1.2.15 * rrdtool-1.2.15
* rsync-2.6.8 * rsync-2.6.9
* rtorrent-0.7.6 * rtorrent-0.7.6
* samba-3.0.26a * samba-3.0.26a
* screen-4.0.3 * screen-4.0.3

View File

@@ -21,8 +21,8 @@
use strict; use strict;
# enable only the following on debugging purpose # enable only the following on debugging purpose
use warnings; #use warnings;
use CGI::Carp 'fatalsToBrowser'; #use CGI::Carp 'fatalsToBrowser';
use File::Copy; use File::Copy;
require '/var/ipfire/general-functions.pl'; require '/var/ipfire/general-functions.pl';
@@ -61,6 +61,15 @@ if ( $cgiparams{'ACTION'} eq "download" )
print @fileholder; print @fileholder;
exit (0); 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" ) elsif ( $cgiparams{'ACTION'} eq "restore" )
{ {
my $upload = $a->param("UPLOAD"); my $upload = $a->param("UPLOAD");
@@ -72,6 +81,18 @@ elsif ( $cgiparams{'ACTION'} eq "restore" )
close UPLOADFILE; close UPLOADFILE;
system("/usr/local/bin/backupctrl restore >/dev/null 2>&1"); 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(); &Header::showhttpheaders();
@@ -90,7 +111,7 @@ if ( $cgiparams{'ACTION'} eq "backup" )
} }
if ( $cgiparams{'ACTION'} eq "addonbackup" ) 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" ) elsif ( $cgiparams{'ACTION'} eq "delete" )
{ {
@@ -151,19 +172,6 @@ END
; ;
&Header::closebox(); &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 ################################################# ############################################# Backups von Addons erstellen #################################################
@@ -183,8 +191,8 @@ print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Siz
print <<END print <<END
<td align='right' width='5'> <td align='right' width='5'>
<form method='post' action='$ENV{'SCRIPT_NAME'}'> <form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ACTION' value='download' /> <input type='hidden' name='ACTION' value='downloadaddon' />
<input type='hidden' name='FILE' value='addons/backup/$_.ipf' /> <input type='hidden' name='FILE' value='$_.ipf' />
<input type='image' alt='$Lang::tr{'download'}' title='$Lang::tr{'download'}' src='/images/package-x-generic.png' /> <input type='image' alt='$Lang::tr{'download'}' title='$Lang::tr{'download'}' src='/images/package-x-generic.png' />
</form> </form>
</td> </td>
@@ -214,5 +222,20 @@ END
} }
print "</table>"; print "</table>";
&Header::closebox(); &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::closebigbox();
&Header::closepage(); &Header::closepage();

View File

@@ -353,8 +353,10 @@
'backup password' => 'Datensicherungs-Passwort', 'backup password' => 'Datensicherungs-Passwort',
'backup sets' => 'Datensicherungssätze', 'backup sets' => 'Datensicherungssätze',
'backup to floppy' => 'Datensicherung auf Diskette', 'backup to floppy' => 'Datensicherung auf Diskette',
'backupaddon' => 'Addonsicherung',
'backupprofile' => 'Falls die Wiederverbindung scheitert, auf Profil umschalten', 'backupprofile' => 'Falls die Wiederverbindung scheitert, auf Profil umschalten',
'backups' => 'Sicherungen', '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' => 'Ungültige Zeichen in ',
'bad characters in script field' => 'Nicht erlaubte Zeichen im Skriptnamen', 'bad characters in script field' => 'Nicht erlaubte Zeichen im Skriptnamen',
'bad characters in the telephone number field' => 'Nicht erlaubte(s) Zeichen im Feld Telefonnummer.', 'bad characters in the telephone number field' => 'Nicht erlaubte(s) Zeichen im Feld Telefonnummer.',

View File

@@ -370,8 +370,10 @@
'backup protect key password' => 'Backup key password', 'backup protect key password' => 'Backup key password',
'backup sets' => 'Backup Sets', 'backup sets' => 'Backup Sets',
'backup to floppy' => 'Backup to floppy', 'backup to floppy' => 'Backup to floppy',
'backupaddon' => 'Addon Backup',
'backupprofile' => 'In case reconnection fails, switch to profile', 'backupprofile' => 'In case reconnection fails, switch to profile',
'backups' => 'backups', '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' => 'Bad characters in ',
'bad characters in script field' => 'Bad characters in script field', 'bad characters in script field' => 'Bad characters in script field',
'bad characters in the telephone number field' => 'Bad characters in the telephone number field.', 'bad characters in the telephone number field' => 'Bad characters in the telephone number field.',

View 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/include /var/ipfire/backup/
install -v -m 644 $(DIR_SRC)/config/backup/exclude /var/ipfire/backup/ install -v -m 644 $(DIR_SRC)/config/backup/exclude /var/ipfire/backup/
chown nobody:nobody -R /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) @$(POSTBUILD)

View File

@@ -67,4 +67,5 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
chown nobody.nobody /var/ipfire/mpfire/{settings,webradio} chown nobody.nobody /var/ipfire/mpfire/{settings,webradio}
chown root.nobody /var/ipfire/mpfire/db/mpd.db chown root.nobody /var/ipfire/mpfire/db/mpd.db
chmod 664 /var/ipfire/mpfire/playlist.m3u chmod 664 /var/ipfire/mpfire/playlist.m3u
install -v -m 644 $(DIR_SRC)/config/backup/includes/mpfire /var/ipfire/backup/addons/includes/mpfire
@$(POSTBUILD) @$(POSTBUILD)

View File

@@ -107,5 +107,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
cp -vfp /var/ipfire/samba/default.printer /var/ipfire/samba/printer 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 cat /var/ipfire/samba/global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf
-mkdir -p /var/log/samba -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) @rm -rf $(DIR_APP)
@$(POSTBUILD) @$(POSTBUILD)

View File

@@ -394,7 +394,6 @@ buildipfire() {
ipfiremake iptables ipfiremake iptables
ipfiremake libupnp ipfiremake libupnp
ipfiremake ipp2p IPT=1 ipfiremake ipp2p IPT=1
ipfiremake moblock
ipfiremake linux-igd ipfiremake linux-igd
ipfiremake ipac-ng ipfiremake ipac-ng
ipfiremake ipaddr ipfiremake ipaddr
@@ -473,7 +472,7 @@ buildipfire() {
ipfiremake htop ipfiremake htop
ipfiremake postfix ipfiremake postfix
ipfiremake fetchmail ipfiremake fetchmail
ipfiremake cyrusimap ipfiremake cyrus-imapd
ipfiremake openmailadmin ipfiremake openmailadmin
ipfiremake mailx ipfiremake mailx
ipfiremake clamav ipfiremake clamav

View File

@@ -36,6 +36,20 @@ remove_files() {
echo "...Finished." 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() { restart_service() {
/etc/init.d/$1 restart /etc/init.d/$1 restart

View File

@@ -2,5 +2,6 @@
. /opt/pakfire/lib/functions.sh . /opt/pakfire/lib/functions.sh
extract_files extract_files
restore_backup ${NAME}
start_service --delay 60 --background ${NAME} start_service --delay 60 --background ${NAME}

View File

@@ -2,3 +2,4 @@
. /opt/pakfire/lib/functions.sh . /opt/pakfire/lib/functions.sh
stop_service ${NAME} stop_service ${NAME}
make_backup ${NAME}

View File

@@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
. /opt/pakfire/lib/functions.sh . /opt/pakfire/lib/functions.sh
make_backup ${NAME}
extract_files extract_files
restore_backup ${NAME}

View 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 ln -svf /var/ipfire/mpfire/mpd.conf /etc/mpd.conf
touch /var/log/mpd.error.log touch /var/log/mpd.error.log
touch /var/log/mpd.log touch /var/log/mpd.log
restore_backup mpfire

View File

@@ -0,0 +1,4 @@
#!/bin/bash
. /opt/pakfire/lib/functions.sh
make_backup mpfire

View File

@@ -0,0 +1,5 @@
#!/bin/bash
. /opt/pakfire/lib/functions.sh
make_backup mpfire
restore_backup mpfire

View File

@@ -560,6 +560,7 @@ END
;; ;;
esac esac
sleep 15
python tools/sendEmail < /tmp/ipfire_mail_body.$$ python tools/sendEmail < /tmp/ipfire_mail_body.$$
if [ "$?" -eq "0" ]; then if [ "$?" -eq "0" ]; then
beautify message DONE beautify message DONE