Last active
December 17, 2015 20:09
-
-
Save christianroman/5665218 to your computer and use it in GitHub Desktop.
Restore tmux session after reboot
This file contains hidden or 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/zsh | |
SESSIONNAME="script" | |
tmux has-session -t $SESSIONNAME &> /dev/null | |
if [ $? != 0 ] | |
then | |
tmux new-session -s $SESSIONNAME -n script -d | |
tmux send-keys -t $SESSIONNAME "~/bin/script" C-m | |
fi | |
tmux attach -t $SESSIONNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment