-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmnt.temp
executable file
·44 lines (37 loc) · 1.03 KB
/
mnt.temp
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
38
39
40
41
42
43
44
#!/bin/bash
# This starts the Fortix Virutal Machin
# Mounts the VM remote directory local
# Runs the local mailserver mailcathcer
# Sets up ssh tunnel for xdebug
# Connects to the server
# start virtual machine
VM="Dresden"
PORT=9000
MAIL_PORT=8080
SLEEP="10s"
VBoxManage startvm "$VM" --type headless
echo "Waiting for network"
while ! ping -c1 $VM &>/dev/null;
do
echo "Ping Fail - `date`";
done ;
echo "Network to VM detected"
echo "Waiting for boot to complete."
sleep $SLEEP
echo "$VM Ready - `date`" ;
# Starting mailcatcher mail server
echo "Starting mailcatcher mail server"
echo "Available on http://mail:$MAIL_PORT"
ssh $VM startmail
# Mount virtual server to local $VM
echo "Mounting Machine to local drive ~/$VM/"
if [ ! -d /home/peter/VMs/ ]; then
mkdir -p /home/peter/VMs/;
fi
sshfs -o follow_symlinks $VM:/home/peter/ ~/VMs/$VM
# Set up ssh tunnel for phpstorm and xdebug
echo "Setting up ssh tunnel for xdebug - Port $PORT"
ssh -R $PORT:localhost:$PORT $VM
# Connect to the server
echo "Connecting to $VM"
ssh $VM