From 973e4f0b4b2a0b91674ec9aa4278e02e37a62eee Mon Sep 17 00:00:00 2001 From: Mikko Lehto Date: Sun, 24 Sep 2017 14:11:02 +0300 Subject: [PATCH] ttyd --- bin/ttyd.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 bin/ttyd.sh diff --git a/bin/ttyd.sh b/bin/ttyd.sh new file mode 100755 index 0000000..ccf2af7 --- /dev/null +++ b/bin/ttyd.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +IF=lo0 +RANDOMPORT=0 +PORT=2620 +CLIENTRECONNECTTIME=10 +MAXCLIENTS=2 +ONCE=--once +CMD="/usr/local/bin/tmux attach-session -t ttyc" +#CREDENTIAL="--credential user:pass" +INFO=7 +NOTICE=6 +DEBUG="--debug $NOTICE" + +timestamp() +{ + TIMEFMT="%Y-%m-%dT%H:%M:%S" + printf $(date +"$TIMEFMT") +} + +ARGS="$DEBUG --interface $IF --port $PORT --readonly --reconnect $CLIENTRECONNECTTIME --max-clients $MAXCLIENTS $CREDENTIAL $ONCE $CMD" +printf "$(timestamp) ttyd $ARGS\n" +ttyd $ARGS +rc=$? +printf "$(timestamp) ttyd rc=$rc\n\n" + +# 2017-09-23 +# doas pkg install ttyd +# FreeBSD tempo 11.0-RELEASE-p12 FreeBSD 11.0-RELEASE-p12 #0: Wed Aug 9 10:03:39 UTC 2017 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 +#$ ttyd -v +#ttyd version 1.3.2 +#ttyd --client-option k=v --> ttyd: unrecognized option `--client-option' --> no LISTEN socket +#ttyd -d --> silent fail +#ttyd -reaonly --> RW! +