distribution/packages/apps/portmaster/scripts/start_portmaster.sh

67 lines
2 KiB
Bash
Raw Normal View History

2023-05-09 16:30:48 +00:00
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
2023-10-24 13:59:09 +00:00
# Copyright (C) 2022-present - The JELOS Project (https://github.com/JustEnoughLinuxOS)
2023-05-09 16:30:48 +00:00
. /etc/profile
jslisten set "PortMaster"
2023-05-09 16:30:48 +00:00
#Make sure PortMaster exists in .config/PortMaster
if [ ! -d "/storage/.config/PortMaster" ]; then
2023-11-13 17:15:48 +00:00
mkdir -p "/storage/.config/PortMaster"
2023-05-09 16:30:48 +00:00
cp -r "/usr/config/PortMaster" "/storage/.config/"
fi
cd /storage/.config/PortMaster
2023-11-10 00:08:15 +00:00
#Grab the latest control.txt
2023-07-06 03:18:52 +00:00
cp /usr/config/PortMaster/control.txt control.txt
2023-11-13 17:15:48 +00:00
cp /usr/config/PortMaster/mapper.txt mapper.txt
2023-05-09 16:30:48 +00:00
#Use our gamecontrollerdb.txt
2023-11-10 00:08:15 +00:00
rm -r gamecontrollerdb.txt
ln -sf /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt gamecontrollerdb.txt
2023-05-09 16:30:48 +00:00
2023-11-10 00:08:15 +00:00
#Delete old PortMaster fold first (we can probably remove this later)
if [ ! -f "/storage/roms/ports/PortMaster/pugwash" ]; then
rm -r /storage/roms/ports/PortMaster
fi
2023-05-09 16:30:48 +00:00
#Make sure roms/ports/PortMaster folder exists
if [ ! -d "/storage/roms/ports/PortMaster" ]; then
2023-11-10 00:08:15 +00:00
unzip /usr/config/PortMaster/release/PortMaster.zip -d /storage/roms/ports/
chmod +x /storage/roms/ports/PortMaster/PortMaster.sh
2023-05-09 16:30:48 +00:00
fi
#We dont use tasksetter, delete it
if [ ! -f /storage/roms/ports/PortMaster/tasksetter ]; then
rm -r /storage/roms/ports/PortMaster/tasksetter
fi
2023-11-10 00:08:15 +00:00
#Use PortMasters gptokeyb
rm gptokeyb
cp /storage/roms/ports/PortMaster/gptokeyb gptokeyb
2023-05-09 16:30:48 +00:00
#Copy over required files for ports
cp /storage/.config/PortMaster/control.txt /storage/roms/ports/PortMaster/control.txt
cp /storage/.config/PortMaster/gamecontrollerdb.txt /storage/roms/ports/PortMaster/gamecontrollerdb.txt
cp /usr/bin/oga_controls* /storage/roms/ports/PortMaster/
#Hide PortMaster folder in ports
if [ ! -f /storage/roms/ports/gamelist.xml ]; then
echo "<gameList>
<folder>
<path>./PortMaster</path>
<name>PortMaster</name>
<hidden>true</hidden>
</folder>
</gameList>" > /storage/roms/ports/gamelist.xml
else
xmlstarlet ed --inplace -u "/gameList/folder[name='PortMaster']/hidden" -v "true" /storage/roms/ports/gamelist.xml
fi
2023-05-09 16:30:48 +00:00
#Start PortMaster
2023-11-10 00:08:15 +00:00
@LIBEGL@
cd /storage/roms/ports/PortMaster
run ./PortMaster.sh 2>/dev/null