Script to start minion in tmux
Minion is a security project from Mozilla (link). It provides a user-friendly web interface to various security scanner tools. There is a webcast demonstrating the software (link).
The software requires a few services to run, and since I like having one script take care of starting everything with the right parameters, I threw together a simple shell script that sets up a tmux session with the services started in windows with the names of the services.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #!/bin/bash session="minion" http="0.0.0.0:8000" cd /opt/minion #------------------------------------------------------------------------------- if [[ "$(tmux list-sessions|cut -d: -f1|grep "^${session}$")" == "${session}" ]] then tmux -2 attach-session -t "${session}" exit fi tmux new-session -s ${session} -d window="${session}:1" tmux send-keys -t "${window}" 'top' Enter window="${session}:2" tmux new-window -t "${window}" -n "task-engine" tmux send-keys -t "${window}" 'source env/bin/activate' Enter tmux send-keys -t "${window}" 'minion-task-engine --debug' Enter window="${session}:3" tmux new-window -t "${window}" -n "plugin-service" tmux send-keys -t "${window}" 'source env/bin/activate' Enter tmux send-keys -t "${window}" 'minion-plugin-service --debug' Enter window="${session}:4" tmux new-window -t "${window}" -n "frontend" tmux send-keys -t "${window}" 'source env/bin/activate' Enter tmux send-keys -t "${window}" 'cd frontend' Enter tmux send-keys -t "${window}" 'python manage.py syncdb' Enter tmux send-keys -t "${window}" "python manage.py runserver ${http}" Enter tmux -2 attach-session -t "${session}" |