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

51 lines
1.6 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
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
2023-11-13 23:03:40 +00:00
cp /storage/.config/PortMaster/gamecontrollerdb.txt /tmp/gamecontrollerdb.txt
cp /usr/bin/oga_controls* /storage/roms/ports/PortMaster/
2023-05-09 16:30:48 +00:00
#Start PortMaster
2023-11-10 00:08:15 +00:00
@LIBEGL@
2023-05-09 16:30:48 +00:00
2023-11-10 00:08:15 +00:00
cd /storage/roms/ports/PortMaster
run ./PortMaster.sh 2>/dev/null