Create 012-jelosaddons
This commit is contained in:
parent
de9e88187f
commit
c5bd7a3b41
1 changed files with 41 additions and 0 deletions
|
@ -0,0 +1,41 @@
|
|||
#!/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 <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<gameList>
|
||||
<game>
|
||||
<path>/storage/roms/ports/JelosAddOns.sh</path>
|
||||
<name>JelosAddOns</name>
|
||||
<hidden>true</hidden>
|
||||
</game>
|
||||
</gameList>
|
||||
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|<gameList>|& \
|
||||
<game>\
|
||||
<path>/storage/roms/ports/JelosAddOns.sh</path>\
|
||||
<name>JelosAddOns</name>\
|
||||
<hidden>true</hidden>\
|
||||
</game>|' /storage/roms/ports/gamelist.xml
|
||||
fi
|
||||
fi
|
||||
|
||||
mv /storage/roms/ports/JelosAddOns/JelosAddOns.sh /storage/roms/ports/JelosAddOns/JelosAddOns
|
Loading…
Reference in a new issue