= 0; --$i) { $ret |= ord($res[$i]); } return !$ret; } } function add_regex($regex, $mode=FILE_APPEND, $append="\n") { global $regexfile; if(file_put_contents($regexfile, $regex.$append, $mode) === FALSE) { $err = error_get_last()["message"]; echo "Unable to add regex \"".htmlspecialchars($regex)."\" to ${regexfile}
Error message: $err"; } else { // Send SIGHUP to pihole-FTL using a frontend command // to force reloading of the regex domains // This will also wipe the resolver's cache echo exec("sudo pihole restartdns reload"); } } ?>