intendation for clearer if-fi pairing

This commit is contained in:
Jack
2020-01-29 02:45:56 +02:00
parent d56f6926ea
commit 9c27d8569c
+19 -20
View File
@@ -826,20 +826,20 @@ iMessage connectivity, see the documentation with the following command:
function delete_temporary_files() { function delete_temporary_files() {
print_dimly "stage: delete_temporary_files" print_dimly "stage: delete_temporary_files"
if [[ "$( VBoxManage list runningvms )" =~ ^\""${vmname}" ]]; if [[ "$( VBoxManage list runningvms )" =~ ^\""${vmname}" ]];
then then
printf 'Temporary files may be deleted when the virtual machine is shut down printf 'Temporary files may be deleted when the virtual machine is shut down
by running the following command at the script'"'"'s working directory: by running the following command at the script'"'"'s working directory:
'"${0} delete_temporary_files"'\n' '"${0} delete_temporary_files"'\n'
else else
# detach temporary VDIs and attach the macOS target disk # detach temporary VDIs and attach the macOS target disk
VBoxManage storagectl "${vmname}" --remove --name SATA >/dev/null 2>&1 VBoxManage storagectl "${vmname}" --remove --name SATA >/dev/null 2>&1
VBoxManage storagectl "${vmname}" --add sata --name SATA --hostiocache on >/dev/null 2>&1 VBoxManage storagectl "${vmname}" --add sata --name SATA --hostiocache on >/dev/null 2>&1
VBoxManage storageattach "${vmname}" --storagectl SATA --port 0 \ VBoxManage storageattach "${vmname}" --storagectl SATA --port 0 \
--type hdd --nonrotational on --medium "${vmname}.vdi" --type hdd --nonrotational on --medium "${vmname}.vdi"
VBoxManage closemedium "Install ${macOS_release_name}.vdi" >/dev/null 2>&1 VBoxManage closemedium "Install ${macOS_release_name}.vdi" >/dev/null 2>&1
VBoxManage closemedium "${macOS_release_name}_BaseSystem.vdi" >/dev/null 2>&1 VBoxManage closemedium "${macOS_release_name}_BaseSystem.vdi" >/dev/null 2>&1
printf 'The following temporary files are safe to delete: printf 'The following temporary files are safe to delete:
"'"${macOS_release_name}_Apple"*'" "'"${macOS_release_name}_Apple"*'"
"'"${macOS_release_name}_BaseSystem"*'" "'"${macOS_release_name}_BaseSystem"*'"
"'"${macOS_release_name}_Install"*'" "'"${macOS_release_name}_Install"*'"
@@ -849,15 +849,15 @@ printf 'The following temporary files are safe to delete:
"'"ApfsDriverLoader.efi"'" "'"ApfsDriverLoader.efi"'"
"'"Apple"*".efi"'" "'"Apple"*".efi"'"
"'"AppleSupport-v2.0.4-RELEASE.zip"'"\n' "'"AppleSupport-v2.0.4-RELEASE.zip"'"\n'
if [ -w "dmg2img.exe" ]; then if [ -w "dmg2img.exe" ]; then
printf ' "'"dmg2img.exe"'"\n' printf ' "'"dmg2img.exe"'"\n'
fi fi
echo "" echo ""
printf "${warning_color}"'Delete temporary files?'"${default_color}" printf "${warning_color}"'Delete temporary files?'"${default_color}"
delete="" delete=""
read -n 1 -p " [y/N] " delete read -n 1 -p " [y/N] " delete
echo "" echo ""
if [ "${delete,,}" == "y" ]; then if [ "${delete,,}" == "y" ]; then
rm "${macOS_release_name}_Apple"* \ rm "${macOS_release_name}_Apple"* \
"${macOS_release_name}_BaseSystem"* \ "${macOS_release_name}_BaseSystem"* \
"${macOS_release_name}_Install"* \ "${macOS_release_name}_Install"* \
@@ -868,8 +868,7 @@ if [ "${delete,,}" == "y" ]; then
"Apple"*".efi" \ "Apple"*".efi" \
"AppleSupport-v2.0.4-RELEASE.zip" 2>/dev/null "AppleSupport-v2.0.4-RELEASE.zip" 2>/dev/null
rm "dmg2img.exe" 2>/dev/null rm "dmg2img.exe" 2>/dev/null
fi fi
fi fi
} }