Skip to content

Instantly share code, notes, and snippets.

@hartym
Created July 20, 2009 04:57
Show Gist options
  • Save hartym/150168 to your computer and use it in GitHub Desktop.
Save hartym/150168 to your computer and use it in GitHub Desktop.
#!/bin/sh
SESSIONNAME=romain
if [ "$1" = "" ]; then
echo "Usage: ssc <host>"
exit
fi
ssh $1 -t if \[ \"\`screen -ls \| grep $SESSIONNAME \| wc -l\`\" -gt 0 \]\; then screen -RD $SESSIONNAME\; else screen -S $SESSIONNAME\; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment