@ -537,23 +537,34 @@ function check_hash() {
}
}
function copy_local(){
function copy_local(){
if [ -n "${ISODIR}" ]; then
case $OS in
# use supplied filename or default to original distro ISO name
windows)
if [ -z ${LOCALISO} ]; then
echo "${OS} not (yet?) supported for local isos" ;;
LOCALISO=${FILE}
macos)
fi
# echo "${OS} not (yet?) supported for local isos" ;;
LOCALFILE=$(find ${ISODIR} -type f -name "${LOCALISO}" -print -quit )
if [ -n "${ISODIR}" ]; then
#echo got local file "${LOCALFILE}"
for macfile in RecoveryImage.dmg RecoveryImage.chunklist
if [ -f "${DIR}/${FILE}" ]; then
do
echo "ERROR! File Exists - not copying over local file"
find "${ISODIR}" -type f -name "${macfile}" -exec cp -pv \{\} "$DIR"/ \;
echo "Move it out of the way to replace it with a local file"
done
exit 1
fi;;
else
*)
cp -pv "${LOCALFILE}" ${DIR}/${FILE}
if [ -n "${ISODIR}" ]; then
# if ! ; then echo ERROR! Failed to copy ${LOCALFILE}" to ${DIR}/${FILE}"
# use supplied filename or default to original distro ISO name
fi
if [ -z "${LOCALISO}" ]; then
#exit 0 # while testing
LOCALISO=${FILE}
fi
fi
LOCALFILE=$(find "${ISODIR}" -type f -name "${LOCALISO}" -print -quit )
if [ -f "${DIR}/${FILE}" ]; then
echo "ERROR! File Exists - not copying over local file"
echo "Move it out of the way to replace it with a local file"
exit 1
else
cp -pv "${LOCALFILE}" "${DIR}"/"${FILE}"
# if ! ; then echo ERROR! Failed to copy ${LOCALFILE}" to ${DIR}/${FILE}"
fi
fi
esac
}
}
function web_get() {
function web_get() {
@ -572,7 +583,14 @@ function web_get() {
echo "ERROR! Unable to create directory ${DIR}"
echo "ERROR! Unable to create directory ${DIR}"
exit 1
exit 1
fi
fi
if [ -n "${LOCALISO}" ] || [ -n "${ISODIR}" ] ; then
copy_local
copy_local
# you only get one shot
LOCALISO=""
ISODIR=""
fi
if command -v aria2c > /dev/null; then
if command -v aria2c > /dev/null; then
if ! aria2c -x16 --continue=true --summary-interval=0 --download-result=hide --console-log-level=error "${URL}" -o "${DIR}/${FILE}"; then
if ! aria2c -x16 --continue=true --summary-interval=0 --download-result=hide --console-log-level=error "${URL}" -o "${DIR}/${FILE}"; then
@ -613,7 +631,12 @@ function zsync_get() {
exit 1
exit 1
fi
fi
if [ -n "${LOCALISO}" ] || [ -n "${ISODIR}" ] ; then
copy_local
copy_local
# you only get one shot
LOCALISO=""
ISODIR=""
fi
if ! zsync "${URL}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then
if ! zsync "${URL}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then
echo "ERROR! Failed to download ${URL}.zsync"
echo "ERROR! Failed to download ${URL}.zsync"
@ -634,6 +657,7 @@ function start_vm_info() {
echo "To start your ${OS} ${RELEASE} virtual machine run:"
echo "To start your ${OS} ${RELEASE} virtual machine run:"
echo " quickemu --vm ${OS}-${RELEASE}.conf"
echo " quickemu --vm ${OS}-${RELEASE}.conf"
echo
echo
exit 0
}
}
function make_vm_config() {
function make_vm_config() {
@ -684,7 +708,7 @@ EOF
echo "fixed_iso=\"${VM_PATH}/${ISO_FILE}\"" >> "${OS}-${RELEASE}.conf"
echo "fixed_iso=\"${VM_PATH}/${ISO_FILE}\"" >> "${OS}-${RELEASE}.conf"
fi
fi
if [ "${OS}" == "alma" ] && [ ${ISOTYPE} == "dvd" ]; then
if [ "${OS}" == "alma" ] && [ " ${ISOTYPE}" == "dvd" ]; then
echo "disk_size=\"32G\"" >> "${OS}-${RELEASE}.conf"
echo "disk_size=\"32G\"" >> "${OS}-${RELEASE}.conf"
fi
fi
@ -1941,10 +1965,10 @@ languages_windows
# handle parameters
# handle parameters
# Take command line arguments
# Take command line arguments
# if [ $# -lt 1 ]; then
if [ $# -lt 1 ]; then
# usage
usage
# exit 0
exit 0
#else
fi
while [ $# -gt 0 ]; do
while [ $# -gt 0 ]; do
case "${1}" in
case "${1}" in
-isodir|--isodir)
-isodir|--isodir)
@ -1967,10 +1991,11 @@ languages_windows
quickemu_version=$( "${whereIam}"/quickemu --version)
quickemu_version=$( "${whereIam}"/quickemu --version)
echo "Quickemu Version: ${quickemu_version}"
echo "Quickemu Version: ${quickemu_version}"
exit 0;;
exit 0;;
test* )
-t|--t|-test|--test )
echo "you are just testing
echo "you are just testing
ISODIR: ${ISODIR}
ISODIR: ${ISODIR}
LOCALISO: ${LOCALISO}"
LOCALISO: ${LOCALISO}"
ls -lh "${ISODIR}/${LOCALISO}"
exit 0;;
exit 0;;
*)
*)