X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fids.cgi;h=f451c5ed456c8fd6faa3f8ba9438063651f9b17d;hp=edf67963b2da9b2f00ece94df530f4e05fdb63d7;hb=dae534f2ca7172a1171d77fe6acd034591233d58;hpb=5508f18c012c5be264c9562b9327a41a2bebb2f8 diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index edf67963b2..f451c5ed45 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -517,23 +517,23 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'update'}) { # Generate file to store the home net. &generate_home_net_file(); - # Open modify sid's file for writing. - open(FILE, ">$modify_sids_file") or die "Could not write to $modify_sids_file. $!\n"; + # Check if the runmode has been changed. + if($cgiparams{'RUN_MODE'} ne $oldidssettings{'RUN_MODE'}) { + # Open modify sid's file for writing. + open(FILE, ">$modify_sids_file") or die "Could not write to $modify_sids_file. $!\n"; - # Write file header. - print FILE "#Autogenerated file. Any custom changes will be overwritten!\n"; + # Write file header. + print FILE "#Autogenerated file. Any custom changes will be overwritten!\n"; - # Check if the configured runmode is IPS. - if ($cgiparams{'RUN_MODE'} eq 'IPS') { - # Tell oinkmaster to switch all rules from alert to drop. - print FILE "modifysid \* \"alert\" \| \"drop\"\n"; - } + # Check if the configured runmode is IPS. + if ($cgiparams{'RUN_MODE'} eq 'IPS') { + # Tell oinkmaster to switch all rules from alert to drop. + print FILE "modifysid \* \"alert\" \| \"drop\"\n"; + } - # Close file handle. - close(FILE); + # Close file handle. + close(FILE); - # Check if the runmode has been changed. - if($cgiparams{'RUN_MODE'} ne $oldidssettings{'RUN_MODE'}) { # Check if a ruleset exists. if (%idsrules) { # Lock the webpage and print message.