#!/bin/bash # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (C) 2020-present Shanti Gilbert (https://github.com/shantigilbert) # Copyright (C) 2020 Fewtarius (https://github.com/fewtarius) BACKUPFILE="/storage/roms/backup/BACKUP.zip" mkdir -p "/storage/roms/backup" case "${1}" in "restore") systemctl stop emustation unzip -o ${BACKUPFILE} -d / systemctl start emustation ;; "backup") [ -f "${BACKUPFILE}" ] && rm "${BACKUPFILE}" [ -z "$2" ] && systemctl stop emustation zip -9 -r ${BACKUPFILE} \ /storage/.cache/bluetooth/* \ /storage/.cache/connman* \ /storage/.config/system/configs/system.cfg \ /storage/.emulationstation/es_*.cfg \ /tmp/joypads/* \ /storage/.config/ppsspp/* \ /storage/.config/retroarch/* \ /storage/.emulationstation/scripts/* [ -z "${2}" ] && systemctl start emustation ;; esac