-
Notifications
You must be signed in to change notification settings - Fork 19
/
deploy
executable file
·56 lines (40 loc) · 1.18 KB
/
deploy
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
50
51
52
53
54
55
56
#!/bin/bash
# VirtualBox Power Driver for MAAS (Metal as a Service)
# Copyright 2021 Saeid Bostandoust <[email protected]>
echo "INFO: Welcome to VirtualBox Power Driver for MAAS (vboxpower)"
which python3 &> /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: Python3 is not installed."
exit 1
fi
which pip3 &> /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: Pip3 is not installed."
exit 1
fi
which virtualbox &> /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: VirtualBox is not installed."
exit 1
else
echo "INFO: VirtualBox is installed on the system."
fi
pip3 freeze | grep vboxapi &> /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: VirtualBox SDK is not installed."
exit 1
else
echo "INFO: VirtualBox SDK is installed on the system."
fi
pip3 install -r requirements.txt &> /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: Cannot install the required packages."
exit 1
else
echo "INFO: Required packages are installed successfully."
fi
cp vboxpower.service /etc/systemd/system/vboxpower.service
mkdir -p /opt/maas/vboxpower
cp vboxpower.py /opt/maas/vboxpower/vboxpower.py
echo "INFO: Starting vboxpower service."
systemctl enable --now vboxpower.service