#!/bin/sh # SPDX-License-Identifier: Apache-2.0 # Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech) #If JelosAddOns does not exist copy JelosAddOns folder to roms/ports if [ ! -e "/storage/roms/ports/JelosAddOns" ] then cp -r /usr/share/JelosAddOns /storage/roms/ports chmod +x /storage/roms/ports/JelosAddOns -R mv /storage/roms/ports/JelosAddOns/JelosAddOns.sh /storage/roms/ports/JelosAddOns.sh fi #Check if gamelist.xml exists, if not create gamelist.xml to hide JelosAddOns by default. if [[ ! -e /storage/roms/ports/gamelist.xml ]]; then touch /storage/roms/ports/gamelist.xml cat > /storage/roms/ports/gamelist.xml < /storage/roms/ports/JelosAddOns.sh JelosAddOns true EOF #If gamelist.xml exists and no JelosAddOns entry exists then add JelosAddOns entry & set to hidden. else if ! grep -R "JelosAddOns" "/storage/roms/ports/gamelist.xml" then sed -i 's||& \ \ /storage/roms/ports/JelosAddOns.sh\ JelosAddOns\ true\ |' /storage/roms/ports/gamelist.xml fi fi mv /storage/roms/ports/JelosAddOns/JelosAddOns.sh /storage/roms/ports/JelosAddOns.sh chmod +x /storage/roms/ports/JelosAddOns/JelosAddOns.sh chmod +x /storage/roms/ports/JelosAddOns -R