Add in the option to restore the default configuration

This commit is contained in:
Luke De Mouy
2016-01-11 15:02:07 -07:00
parent 21f5cf6265
commit 17d2c131b5
2 changed files with 14 additions and 1 deletions

View File

@@ -129,6 +129,15 @@ void Firewall::Restart()
system("/etc/rc.d/ipfw restart");
}
void Firewall::RestoreDefaults()
{
//move the files out of the way
system("mv /etc/ipfw.rules /etc/ipfw.rules.previous");
system("mv /etc/ipfw.openports /etc/ipfw.openports.previous");
//refresh/restart the rules files
system("sh /usr/local/share/pcbsd/scripts/reset-firewall");
}
Firewall::Firewall()
{
readServicesFile();

View File

@@ -55,7 +55,6 @@ public:
* @return a QVector of the open ports
*/
QVector<PortInfo> OpenPorts();
///#endsection
///#section: firewall commands
@@ -76,6 +75,11 @@ public:
* @brief Restarts the firewall
*/
void Restart();
/**
* @brief Restores the Default Configuration
*/
void RestoreDefaults();
///#endsection
///#section: ctors dtors