-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux-runner
executable file
·33 lines (25 loc) · 1 KB
/
tmux-runner
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
#!/bin/bash
VM_GUID="{d0f3631f-9f95-4907-a950-77c674bfcd84}"
# Exit the script if there's a tmux session running
if tmux ls ; then
echo A tmux session is already running. Aborting.
exit 1
fi
tmux new-session -d
tmux split-window -v
# Begin from snapshot
VBoxManage snapshot "$VM_GUID" restorecurrent
VBoxManage startvm "$VM_GUID" --type gui
# Press the home key so a) the first element is selected and b) auto-boot is prevented
# Doing this a couple of times since we don't know how long it takes
for i in `seq 1 7` ; do
sleep 1
VBoxManage controlvm "$VM_GUID" keyboardputscancode e0 47 e0 97
done
tmux send-keys -t 0:0.0 'watch --no-title --interval 0.5 curl -qs http://localhost:8080/vmstatus/CURRENTVM/get-stage/ ; exit' Enter
tmux new-window -d
tmux send-keys -t 0:1 'DISPLAY=:0.0 obs --disable-shutdown-check ; exit' Enter
sleep 5
tmux send-keys -t 0:0.1 'cd ~/archlinux-setup-vb' Enter
tmux send-keys -t 0:0.1 './run-installation ; sleep 4 && killall watch && killall obs ; exit' Enter
tmux a