-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoto.bashrc
More file actions
18 lines (18 loc) · 867 Bytes
/
goto.bashrc
File metadata and controls
18 lines (18 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Auto-screen invocation. see: http://taint.org/wk/RemoteLoginAutoScreen
# if we're coming from a remote SSH connection, in an interactive session
# then automatically put us into a screen(1) session. Only try once
# -- if $STARTED_SCREEN is set, don't try it again, to avoid looping
# if screen fails for some reason.
if [ "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" != x ]
then
STARTED_SCREEN=1 ; export STARTED_SCREEN
[ -d $HOME/lib/screen-logs ] || mkdir -p $HOME/lib/screen-logs
sleep 1
CLUSTER_ROLE=$(grep -e ^Role -e ^Cluster /etc/motd | awk '{print $2}' | cut -f4-6 -d'-' | tr '\n' '.')
export CLUSTER_ROLE
sed -i.bak "s/XXXXX/$CLUSTER_ROLE/" ~/.screenrc
screen -RR && exit 0
# normally, execution of this rc script ends here...
echo "Screen failed! continuing with normal bash startup"
fi
# [end of auto-screen snippet]