30 lines
895 B
Bash
Executable file
30 lines
895 B
Bash
Executable file
#!/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/distribution/configs/distribution.conf \
|
|
/storage/.emulationstation/es_*.cfg \
|
|
/tmp/joypads/* \
|
|
/storage/.config/ppsspp/* \
|
|
/storage/.config/retroarch/* \
|
|
/storage/.emulationstation/scripts/*
|
|
[ -z "${2}" ] && systemctl start emustation
|
|
;;
|
|
esac
|