Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (40 sloc) 1.38 KB
export VIM=$SSHHOME/.sshrc.d
tmuxrc() {
local TMUXDIR=/tmp/.tmux.mattheworiordan
local USE_EC2_COMMAND_PROMPT=true
if ! [ -d $TMUXDIR ]; then
rm -rf $TMUXDIR
mkdir -p $TMUXDIR
fi
rm -rf $TMUXDIR/.sshrc.d
cp -r $SSHHOME/.sshrc $SSHHOME/bashsshrc $SSHHOME/sshrc $SSHHOME/.sshrc.d $TMUXDIR
# TMUX status needs to be executable
chmod +x $TMUXDIR/.sshrc.d/tmux.status
# -S Share a socket in a fixed directory so that sessions for me are retained and reused
local TMUX_COMMAND="/usr/bin/tmux -f $SSHHOME/.sshrc.d/tmux.conf -S $TMUXDIR/tmuxserver"
# CPU and Mem monitor
if [ ! -d "$TMUXDIR/rainbarf" ]; then
echo "TMUX Rainbarf is not installed, installing now..."
mkdir -p "$TMUXDIR/rainbarf"
git clone git://github.com/creaktive/rainbarf.git "$TMUXDIR/rainbarf"
CURRENT_DIR=$PWD
cd "$TMUXDIR/rainbarf"
perl Build.PL
sudo ./Build install
cd $CURRENT_DIR
echo "TMUX Rainbarf installed"
fi
# Setup .vimrc preferences
cp $SSHHOME/.sshrc.d/.vimrc ~/.vimrc
if $TMUX_COMMAND has-session; then
SSHHOME=$TMUXDIR SHELL=$SSHHOME/.sshrc.d/bash-tmux exec $TMUX_COMMAND attach $@
else
SSHHOME=$TMUXDIR SHELL=$SSHHOME/.sshrc.d/bash-tmux exec $TMUX_COMMAND $@
fi
}
export SHELL=`which bash`
# We mostly want to inspect logs when SSH'ing in, so let's just make that easier
if [ -d "/var/log/ably" ]; then
cd /var/log/ably
fi
tmuxrc