Created
August 24, 2015 03:19
-
-
Save wenjianhn/f05e7f546e16e0acfb6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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