-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·49 lines (40 loc) · 1.25 KB
/
install.sh
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
45
46
47
48
49
#!/bin/bash
#
# SPDX-FileCopyrightText: 2021 UdS AES <https://www.uni-saarland.de/lehrstuhl/frey.html>
# SPDX-License-Identifier: Unlicense
# Unset whatever was configured before
# https://stackoverflow.com/a/52128244
unset ${!PROVISION_@}
# Prepare directory for file exchange with VM
DIRECTORY_XFER=./xfer
if [ ! -d $DIRECTORY_XFER ]; then
mkdir $DIRECTORY_XFER
fi
# Provision the virtual machine and install GUI
export PROVISION_FIRST_RUN="true"
vagrant up --provision
# Make user login once so disabling the GNOME default folders works
echo -n "Did you login at least once (credentials \`vagrant\`/\`vagrant\`)? y/n: "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
echo "Ok, continuing..."
vagrant halt
else
echo "That's required! Aborting. Try again."
exit 1
fi
# Verify that directory `./linux_x86_64` exists
DIRECTORY_INSTALL=./linux_x86_64
if [ ! -d $DIRECTORY_INSTALL ]; then
echo "Copy `linux_x86_64/` from the Dymola installation files to `./linux_x86_64`! Aborting."
exit 1
fi
# Install Dymola
export PROVISION_FIRST_RUN="false"
export PROVISION_MOUNT_VAGRANT="true"
vagrant up --provision
vagrant halt
unset ${!PROVISION_@}
# Done!
echo "Done! Boot the VM using \`vagrant up\`"
echo "Then, login with credentials \`vagrant\`/\`vagrant\`"