|
|
@ -1,7 +1,8 @@ |
|
|
|
#!/usr/bin/env bash |
|
|
|
#!/usr/bin/env bash |
|
|
|
|
|
|
|
|
|
|
|
function os_support() { |
|
|
|
function os_support() { |
|
|
|
echo kubuntu \ |
|
|
|
echo freebsd \ |
|
|
|
|
|
|
|
kubuntu \ |
|
|
|
lubuntu \ |
|
|
|
lubuntu \ |
|
|
|
macos \ |
|
|
|
macos \ |
|
|
|
ubuntu \ |
|
|
|
ubuntu \ |
|
|
@ -13,6 +14,12 @@ function os_support() { |
|
|
|
xubuntu |
|
|
|
xubuntu |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function releases_freebsd(){ |
|
|
|
|
|
|
|
echo 13_0 \ |
|
|
|
|
|
|
|
12_2 # replace with 12.3 upon release |
|
|
|
|
|
|
|
# 14_0 # Waiting for 14.0 release |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function releases_macos() { |
|
|
|
function releases_macos() { |
|
|
|
echo high-sierra \ |
|
|
|
echo high-sierra \ |
|
|
|
mojave \ |
|
|
|
mojave \ |
|
|
@ -128,7 +135,10 @@ function make_vm_config() { |
|
|
|
local GUEST="" |
|
|
|
local GUEST="" |
|
|
|
IMAGE_FILE="${1}" |
|
|
|
IMAGE_FILE="${1}" |
|
|
|
ISO_FILE="${2}" |
|
|
|
ISO_FILE="${2}" |
|
|
|
if [[ "${OS}" == *"ubuntu"* ]]; then |
|
|
|
if [[ "${OS}" == "freebsd" ]]; then |
|
|
|
|
|
|
|
GUEST="freebsd" |
|
|
|
|
|
|
|
IMAGE_TYPE="iso" |
|
|
|
|
|
|
|
elif [[ "${OS}" == *"ubuntu"* ]]; then |
|
|
|
GUEST="linux" |
|
|
|
GUEST="linux" |
|
|
|
IMAGE_TYPE="iso" |
|
|
|
IMAGE_TYPE="iso" |
|
|
|
elif [ "${OS}" == "macos" ]; then |
|
|
|
elif [ "${OS}" == "macos" ]; then |
|
|
@ -168,6 +178,39 @@ function start_vm_info() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function get_freebsd() { |
|
|
|
|
|
|
|
# For future releases, use dvd1 iso files. |
|
|
|
|
|
|
|
local URL="" |
|
|
|
|
|
|
|
local CHECKSUMS="" |
|
|
|
|
|
|
|
local DL_BASE="https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES" |
|
|
|
|
|
|
|
local VERSION="" |
|
|
|
|
|
|
|
case ${RELEASE} in |
|
|
|
|
|
|
|
13_0) |
|
|
|
|
|
|
|
VERSION="13.0" |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
12_2) |
|
|
|
|
|
|
|
VERSION="12.2" |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
# Waiting until FreeBSD 14 release |
|
|
|
|
|
|
|
# 14_0) |
|
|
|
|
|
|
|
# VERSION="14.0" |
|
|
|
|
|
|
|
# ;; |
|
|
|
|
|
|
|
*) |
|
|
|
|
|
|
|
echo "ERROR! FreeBSD ${RELEASE} is not a supported release." |
|
|
|
|
|
|
|
releases_freebsd |
|
|
|
|
|
|
|
exit 1 |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
URL="${DL_BASE}/${VERSION}/FreeBSD-${VERSION}-RELEASE-amd64-dvd1.iso" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ISO="FreeBSD-${VERSION}-RELEASE-amd64-dvd1.iso" |
|
|
|
|
|
|
|
web_get ${URL} ${VM_PATH} |
|
|
|
|
|
|
|
make_vm_dir |
|
|
|
|
|
|
|
make_vm_config ${ISO} |
|
|
|
|
|
|
|
start_vm_info |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function get_macos() { |
|
|
|
function get_macos() { |
|
|
|
local CWD="" |
|
|
|
local CWD="" |
|
|
|
local MACRECOVERY="" |
|
|
|
local MACRECOVERY="" |
|
|
@ -380,6 +423,8 @@ VM_PATH="${OS}-${RELEASE}" |
|
|
|
|
|
|
|
|
|
|
|
if [ "${OS}" == "macos" ]; then |
|
|
|
if [ "${OS}" == "macos" ]; then |
|
|
|
get_macos |
|
|
|
get_macos |
|
|
|
|
|
|
|
elif [[ "${OS}" == *"freebsd" ]]; then |
|
|
|
|
|
|
|
get_freebsd |
|
|
|
elif [[ "${OS}" == *"ubuntu"* ]]; then |
|
|
|
elif [[ "${OS}" == *"ubuntu"* ]]; then |
|
|
|
get_ubuntu |
|
|
|
get_ubuntu |
|
|
|
elif [ "${OS}" == "windows" ]; then |
|
|
|
elif [ "${OS}" == "windows" ]; then |
|
|
|