[ previous ] [ next ] [ threads ]
 From:  mtnbkr <waa dash m0n0wall at revpol dot com>
 To:  Guy Widloecher <guy dot widloecher at gmail dot com>
 Cc:  m0n0wall at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall] Recover config.xml from config.cache
 Date:  Tue, 13 May 2008 09:53:42 -0400
GUY!  I am sorry to hear your plight and the amount of work you put into 
this! This is precisely what excellent mailing lists like this are for.
We could have saved you hours and hours worth of work.

Take a look at:


(at the bottom, there is a link to the full, current config.xml)



This will let you download the full, current config.xml which can be 
saved, and then uploaded to a new box with a working floppy.

Bill Arlofski
Reverse Polarity, LLC

Guy Widloecher wrote:
> Hello,
> I have been confronted with the following problem: after a diskette failure,
> the m0n0wall was no longer manageable and the backup of config.xml was not
> up to date!
> Fortunately I could still connect at https://m0n0wall/exec.php.  As I didn't
> find any information on the web, here's what I did:
> On the exec.php page, type the command "cat /tmp/config.cache" (of course,
> do not something like cat /conf/config.xml, it doesn't work because the
> diskette is broken)
> Put its content (a single line) in a file nammed config.cache (I used vi,
> gedit has some trouble with this very long line of text, I don't test with
> other editors).
> In the same folder, write the following php script :
> ----------------
> <?php
> require_once("globals.inc");
> require_once("util.inc");
> require_once("xmlparse.inc");
> $config = unserialize(file_get_contents("config.cache"));
> $xmlconfig = dump_xml_config($config, $g['xml_rootobj']);
> echo var_dump($xmlconfig);
> echo "\n";
> ?>
> --------------------
> Name this script prog.php
> Recover the files globals.inc, util.inc and xmlparse.inc from another
> m0n0wall running the same version or from the corresponding rootfs
> distribution. You should have in the folder : config.cache, prog.php,
> globals.inc, util.inc and xmlparse.inc.
> Run the php script: $ php prog.php
> If everything goes well, you must retrieve the file config.xml.
> I hope that this mini-howto may help somebody encountering the same problem.
> Best regards,
> Guy Widloecher