diff --git a/plugins/module_utils/pfsense.py b/plugins/module_utils/pfsense.py index 7236e04d..07581e1b 100644 --- a/plugins/module_utils/pfsense.py +++ b/plugins/module_utils/pfsense.py @@ -637,11 +637,14 @@ def uniqid(prefix='', more_entropy=False): return prefix + '{0:x}{1:05x}'.format(int(time.time()), int(time.time() * 1000000) % 0x100000) - def phpshell(self, command): + def phpshell(self, command, debug=True): """ Run a command in the php developer shell """ - command = "global $debug;\n$debug = 1;\n" + command + "\nexec\nexit" + phpshell = "" + if debug: + phpshell = "global $debug;\n$debug = 1;\n" + phpshell += command + "\nexec\nexit" # Dummy argument suppresses displaying help message - return self.module.run_command('/usr/local/sbin/pfSsh.php dummy', data=command) + return self.module.run_command('/usr/local/sbin/pfSsh.php dummy', data=phpshell) def php(self, command): """ Run a command in php and return the output """