␊ |
␊ |
# Has the temporary directory /.Chameleon/Extra been created?␊ |
# If yes then transfer temporary Extra folder to destination, ␊ |
# or merge temporary Extra folder in to an already existing Extra␊ |
# folder on the destination target.␊ |
# 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␊ |
␊ |
|
␊ |
␉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␊ |
␊ |
␉␉if [ -d "/Volumes/EFI/Extra" ]; then␊ |
␉␉␉echo "DEBUG: Executing command: Backing up existing /Volumes/EFI/Extra"␊ |
␉␉␉mkdir -p "/Volumes/EFI/ExtraBackup"␊ |
␉␉␉cp -f -R "/Volumes/EFI/Extra" "/Volumes/EFI/ExtraBackup"␊ |
␉␉␉rm -f -R "/Volumes/EFI/Extra"␊ |
␉␉fi␊ |
␊ |
␉␉echo "Executing command: ditto ${3}/.Chameleon/Extra /Volumes/EFI/Extra"␊ |
␉␉ditto ${3}/.Chameleon/Extra /Volumes/EFI/Extra␊ |
␊ |
|
␉␉␉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"␊ |
␉␉fi␊ |
␊ |
␉␉echo "Executing command: ditto ${3}/.Chameleon/Extra ${3}/Extra"␊ |
␉␉ditto ${3}/.Chameleon/Extra ${3}/Extra␊ |
␉fi␊ |