If youre using VMware to run your VM why not just create a template from
your working pfSense VM and export it then each time you need this to
role-out just import it in the destination virtualization host the same
thing if your using KVM.


I am using packer.io. This is a tool for building images directly from the original ISO. It fires up a qemu/kvm virtual machine and does stuff to it (including blind typing if necessary).

> > However I'm happy to drop down either to the Linux shell or the PHP shell.

pfSense is based on FreeBSD.


Oops, sorry about that. Force of habit :-)

Anyway I've cobbled together a PHP script (below) based on bits and pieces found in other scripts. It would be nice though if the existing "pre-flight install" functionality could be exposed as a simple script I could call.

Regards,

Brian.

#!/usr/local/bin/php-cgi -q
<?php
require_once('config.inc');
require_once('functions.inc');
/* from /etc/rc.restore_config_backup */
$file = file_get_contents('http://{{ .HTTPIP }}:{{ .HTTPPort}}/config-class-gw.xml');
if ($file === False) { echo 'Failed to load config'; exit(1); }
file_put_contents('/tmp/config.xml', $file);
conf_mount_rw();
config_restore('/tmp/config.xml');
/* from /usr/local/www/diag_backup.php */
touch('/conf/needs_package_sync_after_reboot');
conf_mount_ro();
?>

_______________________________________________
pfSense mailing list
https://lists.pfsense.org/mailman/listinfo/list
Support the project with Gold! https://pfsense.org/gold

Reply via email to