-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathurllink.env
33 lines (29 loc) · 994 Bytes
/
urllink.env
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
#!/bin/bash
clear
maindir=$PWD
source $maindir/machine-i440fx.sh
VMID=$(whiptail --inputbox "Please enter the Virtual Machine ID?" 8 39 --title "VMID Dialog" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
vmid=$VMID
else
echo "User selected Cancel."
fi
VMNAME=$(whiptail --inputbox "Please enter the Virtual Machine Name?" 8 39 --title "VM Hostname Dialog" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
vmname=$VMNAME
else
echo "User selected Cancel."
fi
URLID=$(whiptail --inputbox "Please enter the Cloud-init URL Link (e.g qcow2 or img) ?" 8 39 https:// --title "URL's Dialog" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
wget -q --show-progress $URLID
FILE=$(basename $URLID)
create_template $VMID $VMNAME $FILE
else
echo "User selected Cancel."
fi
echo "Successfully images template is created"
exit