2022-02-05 14:23:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2020-present Shanti Gilbert (https://github.com/shantigilbert)
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
case "${1}" in
|
|
|
|
"retroarch")
|
|
|
|
rm -f /storage/.config/retroarch/retroarch.cfg
|
|
|
|
cp -rf /usr/config/retroarch/retroarch.cfg /storage/.config/retroarch/retroarch.cfg
|
|
|
|
;;
|
2024-01-09 12:05:50 +00:00
|
|
|
"retroarch-full")
|
|
|
|
rm -rf /storage/.config/retroarch
|
|
|
|
cp -rf /usr/config/retroarch /storage/.config/
|
|
|
|
;;
|
2023-11-16 13:18:46 +00:00
|
|
|
"mednafen")
|
|
|
|
rm -f /storage/.config/mednafen/mednafen.cfg
|
|
|
|
;;
|
2024-01-09 12:05:50 +00:00
|
|
|
"overlays")
|
|
|
|
rm -rf $(cat /usr/lib/systemd/system/tmp-*.mount | grep -Eo 'upperdir=.*,' | sed -e 's~upperdir=~~g; s~,~~g')
|
|
|
|
sync
|
|
|
|
systemctl reboot
|
|
|
|
;;
|
2023-11-03 21:36:34 +00:00
|
|
|
"ALL")
|
2024-01-12 12:20:37 +00:00
|
|
|
swapoff -a
|
2024-01-19 17:24:04 +00:00
|
|
|
umount /storage/roms ||:
|
|
|
|
umount /storage/games-external ||:
|
2023-11-03 21:36:34 +00:00
|
|
|
cd /
|
2024-01-19 17:24:04 +00:00
|
|
|
find /storage -mindepth 1 \( ! -regex '^/storage/.update.*' -a ! -regex '^/storage/roms.*' -a ! -regex '^/storage/games-.*' \) -delete
|
2023-11-03 21:36:34 +00:00
|
|
|
mkdir /storage/.config/
|
|
|
|
sync
|
|
|
|
systemctl reboot
|
|
|
|
;;
|
2022-02-05 14:23:32 +00:00
|
|
|
esac
|