# If yes then check first for an existing /Extra folder on the␊ |
# destination and if exists then back it up and delete existing.␊ |
# Then transfer temporary Extra folder to destination.␊ |
␊ |
␊ |
if [ -d "${3}"/.Chameleon/Extra ]; then␊ |
␊ |
␉# Check to see if install to EFI system partition was selected␊ |
|
␉# have been cancelled, meaning the Extra folder needs to ␊ |
␉# be copied the selected destination.␊ |
␊ |
␉if [ -f ${3}/.Chameleon/nullESP ] && ! [ -f ${3}/.Chameleon/nullstandard ]; then␊ |
␉if [ -f "${3}"/.Chameleon/nullESP ] && ! [ -f "${3}"/.Chameleon/nullstandard ]; then␊ |
␊ |
␉␉# Does an /Extra folder already exist at the target location?␊ |
␉␉# If yes, then make a backup of it␊ |
|
␉␉␉echo "DEBUG: Executing command: Backing up existing /Volumes/EFI/Extra"␊ |
␉␉␉mkdir -p "/Volumes/EFI/ExtraBackup"␊ |
␉␉␉cp -f -R "/Volumes/EFI/Extra" "/Volumes/EFI/ExtraBackup"␊ |
␉␉␉echo "Executing command: rm -f -R /Volumes/EFI/Extra"␊ |
␉␉␉rm -f -R "/Volumes/EFI/Extra"␊ |
␉␉fi␊ |
␊ |
␉␉echo "Executing command: ditto ${3}/.Chameleon/Extra /Volumes/EFI/Extra"␊ |
␉␉ditto ${3}/.Chameleon/Extra /Volumes/EFI/Extra␊ |
␉␉ditto "${3}"/.Chameleon/Extra /Volumes/EFI/Extra␊ |
␊ |
␉␉echo "Executing command: umount -f Volumes/EFI"␊ |
␉␉"$scriptDir"UnMountEFIvolumes.sh␊ |
␉␉returnValue=$?␊ |
␉␉if [ ${returnValue} = 0 ]; then␊ |
␉␉␉echo "Executing command: rm -f -R /Volumes/EFI/"␊ |
␉␉␉rm -R -f /Volumes/EFI␊ |
␉␉fi␊ |
␉else␊ |
␉␉# Does an /Extra folder already exist at the target location?␊ |
␉␉# If yes, then make a backup of it␊ |
␊ |
␉␉if [ -d "${3}/Extra" ]; then␊ |
␉␉␉echo "DEBUG: Executing command: Backing up existing ${3}/Extra"␊ |
␉␉␉mkdir -p "${3}/ExtraBackup"␊ |
␉␉␉cp -f -R "${3}/Extra" "${3}/ExtraBackup"␊ |
␉␉␉rm -f -R "${3}/Extra"␊ |
␉␉if [ -d "${3}"/Extra ]; then␊ |
␉␉␉echo "DEBUG: Backing up existing ${3}/Extra"␊ |
␉␉␉mkdir -p "${3}"/ExtraBackup␊ |
␉␉␉cp -f -R "${3}"/Extra "${3}"/ExtraBackup␊ |
␉␉␉echo "Executing command: rm -f -R ${3}/Extra"␊ |
␉␉␉rm -f -R "${3}"/Extra␊ |
␉␉fi␊ |
␊ |
␉␉echo "Executing command: ditto ${3}/.Chameleon/Extra ${3}/Extra"␊ |
␉␉ditto ${3}/.Chameleon/Extra ${3}/Extra␊ |
␉␉ditto "${3}"/.Chameleon/Extra "${3}"/Extra␊ |
␉fi␊ |
␊ |
fi␊ |
|
echo "Clean Up"␊ |
echo "********"␊ |
␊ |
# remove the temporary /.Chameleon directory␊ |
echo "Executing command: rm -r ${3}/.Chameleon/"␊ |
rm -r "${3}"/.Chameleon/␊ |
# check the /.Chameleon temporary directory exists␊ |
# if yes, remove the temporary /.Chameleon directory␊ |
␊ |
if [ -d "${3}"/.Chameleon ]; then␊ |
␉echo "Executing command: rm -r ${3}/.Chameleon/"␊ |
␉rm -r "${3}"/.Chameleon␊ |
fi␊ |
␊ |
# remove the temporary boot sector files if they exist␊ |
if [ -d /tmp/newbs ]; then␊ |
␉echo "Executing command: rm /tmp/newbs"␊ |