summarylogtreecommitdiffstats
path: root/controlloid-server.sh
diff options
context:
space:
mode:
Diffstat (limited to 'controlloid-server.sh')
-rwxr-xr-xcontrolloid-server.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/controlloid-server.sh b/controlloid-server.sh
new file mode 100755
index 000000000000..0844691d4739
--- /dev/null
+++ b/controlloid-server.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# cd "$(dirname "${BASH_SOURCE[0]}")"
+
+LINK_FORMAT=$(printf '\e[34;4m')
+RESET_FORMAT=$(printf '\e[0m')
+
+echo "Server addresses:"
+ip -4 -o addr show scope global | awk '{gsub(/\/.*/,"",$4); print $2, "http://"$4":31415/"}' | sort | sed "s/\(http.\+\)/${LINK_FORMAT}\1${RESET_FORMAT}/"
+echo ""
+
+echo "Starting server..."
+websocketd --binary --port 31415 --staticdir=. /usr/bin/controlloid/bin/ws_handler