summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-07-25 16:08:11 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-08-15 13:03:28 +1000
commit606c23f642a4e8a3a238cdbc3cd10d74708cbfad (patch)
tree8967e27d99f30ba282ff892b1aa23f11c786368b
parent2914110af0cc490566446f18c929452368121b98 (diff)
downloadtalos-petitboot-606c23f642a4e8a3a238cdbc3cd10d74708cbfad.zip
talos-petitboot-606c23f642a4e8a3a238cdbc3cd10d74708cbfad.tar.gz
utils: Add pb-exec wrapper
Add a small wrapper script for the Petitboot UI to call interactable programs with. The wrapper calls the program and waits for user input before returning to the Petitboot UI. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rwxr-xr-xutils/pb-exec16
1 files changed, 16 insertions, 0 deletions
diff --git a/utils/pb-exec b/utils/pb-exec
new file mode 100755
index 0000000..bfe13f6
--- /dev/null
+++ b/utils/pb-exec
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Run a program specified by Petitboot.
+$@
+echo "$0 ran '$@'"
+
+# Wait for the user to exit back to Petitboot.
+read -n 1 -r -p "Press ENTER to return to Petitboot or any other key to drop to a shell" key
+
+if [ "$key" == "" ]; then
+ echo "Returning to Petitboot.."
+ exit 0
+fi
+
+printf "\nLaunching shell. Type 'exit' to return\n"
+/bin/sh
OpenPOWER on IntegriCloud