#!/bin/bash
tmux new-session -d -s mySession -n myWindow
# this statement is a life-saver for tmux detached sessions
# In my case running the script in a new window worked
tmux send-keys -t mySession:myWindow "/Users/wu/soft/nexus-3.13.0-01/bin/nexus run" Enter
tmux new-window -n redis
tmux send-keys -t mySession:redis "/usr/local/bin/redis-server /usr/local/etc/redis.conf" Enter
tmux new-window -n wutoday
tmux send-keys -t mySession:wutoday "/Users/wu/soft/apache-tomcat-8.0.50-2/bin/startup.sh" Enter
tmux new-window -n gogs
tmux send-keys -t mySession:gogs "/Users/wu/soft/gogs/gogs web" Enter
tmux new-window -n pfctlload
tmux send-keys -t mySession:pfctlload "echo "wujiatong1234" | sudo -S pfctl -f /etc/pf.conf" Enter
tmux new-window -n pfctlenable
tmux send-keys -t mySession:pfctlenable "echo "wujiatong1234" | sudo -S pfctl -e" Enter
tmux attach -t mySession:myWindow