common: move asyncSystem() to common
asyncSystem() is shared across updaters, so moved to common.
Change-Id: I3545d34ecc1f1bf8a226d020267ae00bcf42c5f9
Signed-off-by: Kevin Tung <Kevin.Tung@quantatw.com>
diff --git a/common/include/utils.hpp b/common/include/utils.hpp
new file mode 100644
index 0000000..928b136
--- /dev/null
+++ b/common/include/utils.hpp
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <sdbusplus/async.hpp>
+
+/**
+ * @brief Asynchronously executes a shell command.
+ * @param ctx Async context for monitoring the pipe.
+ * @param cmd Shell command to execute.
+ * @return Task resolving to true on success (exit code 0), false otherwise.
+ */
+sdbusplus::async::task<bool> asyncSystem(sdbusplus::async::context& ctx,
+ const std::string& cmd);