aboutsummaryrefslogtreecommitdiff
path: root/libraries/Bridge/Process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/Bridge/Process.cpp')
-rw-r--r--libraries/Bridge/Process.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libraries/Bridge/Process.cpp b/libraries/Bridge/Process.cpp
index 78f168f..219922a 100644
--- a/libraries/Bridge/Process.cpp
+++ b/libraries/Bridge/Process.cpp
@@ -118,6 +118,20 @@ void Process::close() {
started = false;
}
+unsigned int Process::runShellCommand(const String &command) {
+ runShellCommandAsynchronously(command);
+ while (running())
+ delay(100);
+ return exitValue();
+}
+
+void Process::runShellCommandAsynchronously(const String &command) {
+ begin("/bin/ash");
+ addParameter("-c");
+ addParameter(command);
+ runAsynchronously();
+}
+
// This method is currently unused
//static unsigned int __commandOutputAvailable(uint8_t handle) {
// uint8_t cmd[] = {'o', handle};