From bf16b7b8593d4013adbd03838af5a2fb3bce34ee Mon Sep 17 00:00:00 2001 From: epoch Date: Wed, 6 Feb 2019 00:53:08 -0600 Subject: I forgot to add the examples dir somehow. they're back. tictactoe works again too. --- .../hackvr/examples/filebrowser/backend-gopher.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 share/hackvr/examples/filebrowser/backend-gopher.sh (limited to 'share/hackvr/examples/filebrowser/backend-gopher.sh') diff --git a/share/hackvr/examples/filebrowser/backend-gopher.sh b/share/hackvr/examples/filebrowser/backend-gopher.sh new file mode 100755 index 0000000..ab360da --- /dev/null +++ b/share/hackvr/examples/filebrowser/backend-gopher.sh @@ -0,0 +1,22 @@ +#!/bin/bash +#give a list of files. +#wait for a selection on stdin +#cd or start that file +#repeat. +server=$1 +${server:="gopher.hacking.allowed.org"} +#gopher.hacking.allowed.org +port=70 +selection=/ +while true;do +#not sure why this needs to be printed to show up every time. + printf "/\n" + printf '%s\n' "$selection" | ncat "$server" "$port" | tee /dev/stderr | grep -v ^i | cut -f2 | tr -d '\r' +### need to ask user for input in the form of a pop-up window if the selected target was of type 7 + read -r selection + if [ "_" = "_$selection" ];then + echo "looks like there's nothing here. exiting." >&2 + exit 1 + fi + echo +done -- cgit v1.2.3