-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathlinux_installation.sh
executable file
·50 lines (37 loc) · 1.05 KB
/
linux_installation.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
50
#!/bin/bash
# Make sure only root can run our script
#if [[ $EUID -ne 0 ]]; then
#echo "This script must be run as root" 1>&2
# exit 1
#fi
echo "Please choose if this installation is host (h) or guest (g) side installation:"
read -p 'Selection: ' sel
if [ $sel == 'h' ]
then
param='host'
elif [ $sel == 'g' ]
then
param='vm'
else
echo "[X] Unknown parameter. Exiting."
exit 1
fi
echo "[~] Thank you. Installation will proceed for $param."
# install python
sh -c "sudo apt-get install python3 -y -qqq"
echo " [+] python installed."
# call pre_setup.py
sh -c "sudo python3 pre_setup.py $param"
sh -c "python3 setup.py install --user"
echo " [+] pre_setup finished successfully."
if [ $sel == 'h' ]
then
echo "Please check if your chosen user has been added to groups libvirt and libvirtd. If this is not the case, restart the shell or reboot your system."
echo "You will be asked to enter your user password again in an attempt to reload your shell. "
fi
echo "[+] Installation complete."
if [ $sel == 'h' ]
then
su - $USER
fi
exit 0