-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
47 lines (33 loc) · 1.22 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
#!/bin/bash
set -e
proxmoxVersion=$(pveversion --verbose| grep proxmox-ve| cut -d" " -f2| cut -d"." -f1 )
currentDirectory=$(pwd)
outputDirectory="/opt/Proxmox-Cloud-Image-Importer"
if ! [ -x "$(command -v git)" ]; then
echo "Installing Git... \n\n"
apt-get install git -y
else
echo "Git is already installed. Skipping... \n\n"
fi
if ! [ -x "$(command -v pip3)" ]; then
echo "Installing Python3 Pip... \n\n"
apt-get install python3-pip -y
else
echo "Python3 Pip is already installed. Skipping... \n\n"
fi
echo "Downloading importer... \n\n"
git clone https://github.com/ggMartinez/Proxmox-Cloud-Image-Importer $outputDirectory && cd $outputDirectory && git config core.fileMode false
echo "Installing requirements\n\n"
if [ "$proxmoxVersion" = "7" ]
then
pip3 install -r requirements.txt
fi
if [ "$proxmoxVersion" = "8" ]
then
pip3 install -r requirements.txt --break-system-packages
fi
echo "Creating symlink in /usr/local/bin/cloud-import... \n\n"
ln -s $outputDirectory/cloud-import.py /usr/local/bin/cloud-import && chmod +x $outputDirectory/cloud-import.py
echo "Installed!! Run with 'cloud-import' \n"
echo "If you want to update, run \"cd $outputDirectory && git pull\".\n\n"
cd $currentDirectory