distribution/packages/jelos/sources/scripts/backuptool
fewtarius 58769c80d3
* Restructure JELOS to use .config/system and system.cfg for configuration.
* Update games to use .config/game/configs moving configurations out of the system config root.
* Split modules into a separate package (packages/misc/modules).
* Remove some unused packages and move a few virtual packages to packages/virtual.
2022-02-26 21:40:30 -05:00

30 lines
882 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/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