mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-13 08:29:32 +02:00
* configlets/freebsd/installer_commands_root: see #2143 "installer
should run /etc/rc.d/pf script to reload PF rules on FreeBSD when generated script is in rc.conf format"
This commit is contained in:
+5
-1
@@ -1,4 +1,8 @@
|
|||||||
2011-02-24 vadim <vadim@netcitadel.com>
|
2011-02-24 Vadim Kurland <vadim@netcitadel.com>
|
||||||
|
|
||||||
|
* configlets/freebsd/installer_commands_root: see #2143 "installer
|
||||||
|
should run /etc/rc.d/pf script to reload PF rules on FreeBSD when
|
||||||
|
generated script is in rc.conf format"
|
||||||
|
|
||||||
* AddressTableDialog.cpp (browse): see #2140 "Attempting to create
|
* AddressTableDialog.cpp (browse): see #2140 "Attempting to create
|
||||||
new Address Table file results in read-only error". Implemented
|
new Address Table file results in read-only error". Implemented
|
||||||
|
|||||||
@@ -690,6 +690,8 @@ QString FirewallInstaller::getActivationCmd()
|
|||||||
return cnf->activationCmd;
|
return cnf->activationCmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FWOptions *fwopt = cnf->fwobj->getOptionsObject();
|
||||||
|
|
||||||
QString configlet_name = "installer_commands_";
|
QString configlet_name = "installer_commands_";
|
||||||
if (cnf->user=="root") configlet_name += "root";
|
if (cnf->user=="root") configlet_name += "root";
|
||||||
else configlet_name += "reg_user";
|
else configlet_name += "reg_user";
|
||||||
@@ -720,6 +722,16 @@ QString FirewallInstaller::getActivationCmd()
|
|||||||
configlet.setVariable("with_compression", cnf->compressScript);
|
configlet.setVariable("with_compression", cnf->compressScript);
|
||||||
configlet.setVariable("no_compression", ! cnf->compressScript);
|
configlet.setVariable("no_compression", ! cnf->compressScript);
|
||||||
|
|
||||||
|
// On FreeBSD where we can generate either shell script or rc.conf
|
||||||
|
// file, installation commands differ.
|
||||||
|
//
|
||||||
|
// TODO: find more generic way to do this so that GUI installer does not
|
||||||
|
// have to be aware of the differences in generated file format.
|
||||||
|
configlet.setVariable("rc_conf_format",
|
||||||
|
fwopt->getBool("generate_rc_conf_file"));
|
||||||
|
configlet.setVariable("shell_script_format",
|
||||||
|
! fwopt->getBool("generate_rc_conf_file"));
|
||||||
|
|
||||||
replaceMacrosInCommand(&configlet);
|
replaceMacrosInCommand(&configlet);
|
||||||
|
|
||||||
return configlet.expand().trimmed();
|
return configlet.expand().trimmed();
|
||||||
|
|||||||
@@ -28,6 +28,15 @@
|
|||||||
## on the input of sudo and other commands. This creates difficult to catch
|
## on the input of sudo and other commands. This creates difficult to catch
|
||||||
## race condition which breaks installation process.
|
## race condition which breaks installation process.
|
||||||
|
|
||||||
|
{{if shell_script_format}}
|
||||||
|
echo '{{$fwbprompt}}';
|
||||||
|
chmod +x {{$fwdir}}/{{$fwscript}};
|
||||||
|
sudo -S {{$fwdir}}/{{$fwscript}} && ( echo 'Policy activated'; sleep 2; echo)
|
||||||
|
{{endif}}
|
||||||
|
|
||||||
|
{{if rc_conf_format}}
|
||||||
|
echo '{{$fwbprompt}}';
|
||||||
|
sudo -S /etc/rc.d/pf reload && ( echo 'Policy activated'; sleep 2; echo)
|
||||||
|
{{endif}}
|
||||||
|
|
||||||
echo '{{$fwbprompt}}'; chmod +x {{$fwdir}}/{{$fwscript}}; sudo -S {{$fwdir}}/{{$fwscript}} && ( echo 'Policy activated'; sleep 2; echo)
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,15 @@
|
|||||||
## See #1368 for the explanation of the need for the "sleep2; echo" commands
|
## See #1368 for the explanation of the need for the "sleep2; echo" commands
|
||||||
|
|
||||||
|
|
||||||
|
{{if shell_script_format}}
|
||||||
echo '{{$fwbprompt}}';
|
echo '{{$fwbprompt}}';
|
||||||
chmod +x {{$fwdir}}/{{$fwscript}};
|
chmod +x {{$fwdir}}/{{$fwscript}};
|
||||||
sh {{$fwdir}}/{{$fwscript}} && ( echo 'Policy activated'; sleep 2; echo)
|
sh {{$fwdir}}/{{$fwscript}} && ( echo 'Policy activated'; sleep 2; echo)
|
||||||
|
{{endif}}
|
||||||
|
|
||||||
|
{{if rc_conf_format}}
|
||||||
|
echo '{{$fwbprompt}}';
|
||||||
|
/etc/rc.d/pf reload && ( echo 'Policy activated'; sleep 2; echo)
|
||||||
|
{{endif}}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user