As part of my post-receive hook I checkout the HEAD of the repository and then run my start-up command.
So when I do git push it works fine.
Thing is, when i SSH into the box, I use byobu. Is there a way to get the post-receive hook to run my start-up command inside a byobu session, so that when I SSH in, I can see my app running?
Byobu is just a wrapper around screen
or tmux
, so you want to send your command to one of those.
If you use tmux
, you can just use the following command to litarally type in a command, then press enter, in the window number 2:
tmux send-keys -t 1 "start-app.sh" C-m
To set up byobu
to use tmux
, use either the command byobu-select-backend
or start it with byobu-tmux
.