Add following lines to /etc/rc.local
:
USER="myusername"
su ${USER} -c '/home/${USER}/apps/run'
Place a file at /home/myusername/apps/run
with the following content:
#/bin/bash
SESSION="apps"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
AVAILABLE_WINDOW=1
run-in-tmux() {
tmux new-window -t ${SESSION}:${AVAILABLE_WINDOW}
tmux send-keys -t ${SESSION}:${AVAILABLE_WINDOW} "$*" C-m
AVAILABLE_WINDOW=$((${AVAILABLE_WINDOW}+1))
}
tmux start-server
tmux new-session -d -s ${SESSION}
run-in-tmux 'cd wifi-232-demo; ./tcp-server.py'
run-in-tmux 'cd aktos-scada-live; make production-run-server'
run-in-tmux 'cd aktos-scada-live/tools; python broker.py'
run-in-tmux 'cd aktos-scada-live/tools; python virtual-io-server.py'