blob: 0844691d473973076f0585fb17f8f643d9c66e54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
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
|