Skip to content

Instantly share code, notes, and snippets.

@wenjianhn
Created August 24, 2015 03:19
Show Gist options
  • Save wenjianhn/f05e7f546e16e0acfb6c to your computer and use it in GitHub Desktop.
Save wenjianhn/f05e7f546e16e0acfb6c to your computer and use it in GitHub Desktop.
#!/bin/bash
SESSIONNAME="MidoNet"
tmux has-session -t $SESSIONNAME &> /dev/null
if [ $? != 0 ]
then
tmux new-session -s $SESSIONNAME -n script -d
tmux send-keys -t $SESSIONNAME "tailf /var/log/midolman/midolman.log" C-m
tmux new-window -t $SESSIONNAME '/bin/bash'
tmux send-keys -t $SESSIONNAME "systemctl restart midolman"
fi
tmux attach -t $SESSIONNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment