summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 2be1f39..b129824 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -490,6 +490,22 @@ function log_error($error) {
return;
}
+/****f* util/exec_command
+ * NAME
+ * exec_command - Execute a command and return a string of the result.
+ * INPUTS
+ * $command - String of the command to be executed.
+ * RESULT
+ * String containing the command's result.
+ * NOTES
+ * This function returns the command's stdout and stderr.
+ ******/
+function exec_command($command) {
+ $output = array();
+ exec($command . ' 2>&1 ', $output);
+ return(implode("\n", $output));
+}
+
/* wrapper for exec() */
function mwexec($command, $mute = false) {
OpenPOWER on IntegriCloud