diff options
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 0f89313..e16c2d2 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -756,10 +756,12 @@ function add_rule_to_anchor($anchor, $rule, $label) { */ function remove_text_from_file($file, $text) { global $fd_log; - fwrite($fd_log, "Adding needed text items:\n"); + if($fd_log) + fwrite($fd_log, "Adding needed text items:\n"); $filecontents = exec_command_and_return_text("cat " . $file); $textTMP = str_replace($text, "", $filecontents); $text .= $textTMP; + if($fd_log) fwrite($fd_log, $text . "\n"); $fd = fopen($file, "w"); fwrite($fd, $text); |