This repository has been archived on 2025-03-19. You can view files and clone it, but cannot push or open issues or pull requests.
FlashBackScripts/_FlashBackRestore
2019-04-02 08:41:43 -06:00

29 lines
806 B
Bash
Executable file

#!/bin/bash
shopt -s extglob # "Shell option set extglob" https://www.linuxjournal.com/content/bash-extended-globbing
set -f # "Disable file name generation (globbing)."
SELECTBACKUP=$1
set +f
FLASHBACKDIR="/Library/FlashBack"
SELECTLOCATION=$FLASHBACKDIR/Backups/$SELECTBACKUP
# COPY BACKUP TO SYSTEM
cp -r $SELECTLOCATION/Preferences/* /var/mobile/Library/Preferences/ || STATUS="cp failed"
cp -r $SELECTLOCATION/SBFolder/* /var/mobile/Library/SpringBoard/ || STATUS="cp failed"
if [[ -d $SELECTLOCATION/AutoWall/ ]]
then
cp -rf "$SELECTLOCATION/AutoWall/"* "/var/mobile/Media/AutoWall/" &>/dev/null
fi
# clear caches and respring
uicache
recache --no respring &>/dev/null
killall cfprefsd #Clear settings caches - thanks to Grant/NewD
killall -9 SpringBoard && exit 0 # Kill the script.
exit 0