Skip to content

Commit

Permalink
fix url without random bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ariary committed Sep 16, 2022
1 parent ea5ebac commit 6ab7a70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
19 changes: 19 additions & 0 deletions light-pty4all/socat-forker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash -x

SOCKDIR=$(mktemp -d)
SOCKF=${SOCKDIR}/usock

# Start tmux, if needed
tmux start
# Create window
tmux new-window "socat UNIX-LISTEN:${SOCKF},umask=0077 file:\`tty\`,raw,echo=0"
# Wait for socket
while test ! -e ${SOCKF}; do sleep 1; done
SOCAT_TTY=$(tty)

# space for no history, gitar shortcut
echo " $(gitar --dry-run -e -p 9292)" > ${SOCAT_TTY}
echo " clear" > ${SOCAT_TTY}

# Use socat to ship data between the unix socket and STDIO.
exec socat file:${SOCAT_TTY},raw,echo=0 UNIX-CONNECT:${SOCKF}
3 changes: 1 addition & 2 deletions light-pty4all/socat-listener-behind-bore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ tmux split-window -v "bore local 9292 --to bore.pub" #TODO: 9292 port as a flag
printf "${TEAL}please enter bore.pub remote_port given? ${NC}"
read BPORT
BENDPOINT="bore.pub:${BPORT}"
URL="http:https://${BENDPOINT}/${SECRET}"

#gitar shortcut + launch gitar
if [[ ! $WINDOWS ]]; then
Expand All @@ -89,7 +88,7 @@ fi
echo "[+] launch gitar server"
SECRET=$RANDOM
tmux split-window -h "gitar -a https://${BENDPOINT} -f ${LPORT} --secret ${SECRET}"

URL="http:https://${BENDPOINT}/${SECRET}"

# put tacos in current directory
PWD=$(pwd)
Expand Down

0 comments on commit 6ab7a70

Please sign in to comment.