# If not already in screen reattach to a running session or create a new one.
# This also starts screen one a remote server when connecting through ssh.
# If not already in screen reattach to a running session or create a new one.
# This also starts screen one a remote server when connecting through ssh.
# Get running detached sessions.
session=$(screen -list | grep 'Detached' | awk '{ print $1; exit }')
# Get running detached sessions.
session=$(screen -list | grep 'Detached' | awk '{ print $1; exit }')