mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Add in the option to restore the default configuration
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user