Skip to content

Instantly share code, notes, and snippets.

@etam
Created April 26, 2016 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etam/398fb0f1d24e653dbebe40d565b80fbe to your computer and use it in GitHub Desktop.
Save etam/398fb0f1d24e653dbebe40d565b80fbe to your computer and use it in GitHub Desktop.
#!/bin/bash
if (( $# != 1 )); then
echo "Usage: $(basename "$0") /tmp/path/to/socket"
exit 1
fi
if [[ ! -S "$1" ]]; then
echo "$1 is not a socket"
exit 2
fi
trap 'kill 0' EXIT
socat UNIX-CONNECT:${1} PTY,link=${1}_pty &
sleep 0.1
screen ${1}_pty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment