distribution/packages/themes/thememaster/sources/autostart/common/011-thememaster

41 lines
1.2 KiB
Text
Raw Normal View History

#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
# Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech)
#If ThemeMaster does not exist copy ThemeMaster folder to roms/ports
if [ ! -e "/storage/roms/ports/ThemeMaster" ]
then
cp -r /usr/share/ThemeMaster /storage/roms/ports
chmod +x /storage/roms/ports/ThemeMaster -R
mv /storage/roms/ports/ThemeMaster/ThemeMaster.sh /storage/roms/ports/ThemeMaster.sh
fi
2022-08-24 18:42:08 +00:00
#Check if gamelist.xml exists, if not create gamelist.xml to hide ThemeMaster 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/ThemeMaster.sh</path>
<name>ThemeMaster</name>
<hidden>true</hidden>
</game>
</gameList>
EOF
2022-08-24 18:42:08 +00:00
#If gamelist.xml exists and no ThemeMaster entry exists then add ThemeMaster entry & set to hidden.
else
if ! grep -R "ThemeMaster" "/storage/roms/ports/gamelist.xml"
then
sed -i 's|<gameList>|& \
<game>\
<path>/storage/roms/ports/ThemeMaster.sh</path>\
<name>ThemeMaster</name>\
<hidden>true</hidden>\
</game>|' /storage/roms/ports/gamelist.xml
fi
fi