script launches app into the background via screen
authorChris Koeritz <fred@gruntose.com>
Thu, 10 May 2018 00:13:07 +0000 (20:13 -0400)
committerChris Koeritz <fred@gruntose.com>
Thu, 10 May 2018 00:13:07 +0000 (20:13 -0400)
this will take an app name and wrap the app in a screen session.  second parm is a title, but the app name will be used if no title provided.  very rudimentary right now but working.

scripts/system/screeno.sh [new file with mode: 0644]

diff --git a/scripts/system/screeno.sh b/scripts/system/screeno.sh
new file mode 100644 (file)
index 0000000..5217d70
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# screeno: a simple alias for putting something in the background where its logs can be
+# tended by the screen utility.
+
+app="$1"; shift
+title="$1"; shift
+if [ -z "$app" ]; then
+#print_instructions
+  echo This utility needs an application name to launch into the background.
+  echo The app will be managed via the screen utility so its logs are available
+  echo later, plus it can be interacted with directly.
+  exit 1
+fi
+if [ -z "$title" ]; then
+  title="$app"
+#hmmm: we should be sanitizing that guy!  don't want a long deal title.
+fi
+
+screen -L -S "$title" -d -m "$app"
+
+
+
+