change for new pid script

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2021-05-15 23:48:45 +02:00
parent 8c3bdba798
commit 4b519d9911
23 changed files with 85 additions and 62 deletions

View File

@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
mednafen -fs 1 -gg.stretch full "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -3,6 +3,6 @@
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
sdlgnuboy --syncrtc --stereo=0 "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -4,7 +4,7 @@
# for the process to terminate and erase the recorded PID
cd ${HOME}
gpsp "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -3,6 +3,6 @@
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
gpsp "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
mednafen -fs 1 -lynx.stretch full "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
mednafen -sound 1 -soundrate 22050 -soundbufsize 100 -vdriver sdl -frameskip 1 -fs 0 "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -3,6 +3,6 @@
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
PicoDrive "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -3,6 +3,6 @@
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
fceux "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
mednafen -fs 1 -ngp.stretch full "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
mednafen -fs 1 -force_module pce_fast -pce_fast.stretch full "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -3,6 +3,6 @@
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
pcsx -frameskip -cdfile "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -3,6 +3,6 @@
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
pcsx -cdfile "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -3,6 +3,6 @@
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
PicoDrive "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -3,6 +3,6 @@
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
psnes "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -3,6 +3,6 @@
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
psnes "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
# Launch the process in background, record the PID into a file, wait
# for the process to terminate and erase the recorded PID
mednafen -fs 1 -wswan.stretch full "$1"&
record_pid $!
pid record $!
wait $!
erase_pid
pid erase

View File

@ -1,12 +0,0 @@
#!/bin/sh
# Uncomment the following line to get debug info
#set -x
# Check args
if [ ${#} -ne 0 ]; then
echo "Usage: $(basename ${0})"
exit 1
fi
rm -f /var/run/funkey.pid
exit 0

View File

@ -94,9 +94,9 @@ init_frontend() {
# Record the PID into a file, wait for the process to
# terminate and erase the recorded PID
record_pid $!
pid record $!
wait $!
erase_pid
pid erase
# In case retrofe/opkrun quits with errors, clear graphic VT
termfix_all

View File

@ -57,9 +57,9 @@ case ${1} in
# terminate and erase the recorded PID
cat << EOF >> "${INSTANT_PLAY_FILE}"
&
record_pid \$!
pid record \$!
wait \$!
erase_pid
pid erase
EOF
# Now terminate gracefully

View File

@ -0,0 +1,47 @@
#!/bin/sh
# Uncomment the following line to get debug info
#set -x
SELF="$(basename ${0})"
PID_FILE="/var/run/funkey.pid"
usage() {
>&2 echo "Usage: ${SELF} record pid"
>&2 echo " ${SELF} erase"
exit 1
}
record_pid() {
local pid="${1}"
if ! [ ! "${pid}" -ne "${pid}" ]; then
>&2 echo "error: ${pid} is not a number"
exit 2
fi
echo "${1}" > "${PID_FILE}"
}
erase_pid() {
rm -f "${PID_FILE}"
}
case "${1}" in
record)
if [ ${#} -ne 2 ]; then
usage
fi
record_pid "${2}"
;;
erase)
if [ ${#} -ne 1 ]; then
usage
fi
erase_pid
;;
*)
usage
;;
esac
exit 0

View File

@ -1,12 +0,0 @@
#!/bin/sh
# Uncomment the following line to get debug info
#set -x
# Check args
if [ ${#} -ne 1 ]; then
echo "Usage: $(basename ${0}) pid"
exit 1
fi
echo ${1} > /var/run/funkey.pid
exit 0

View File

@ -4,7 +4,7 @@
#
################################################################################
PRODSCREENS_VERSION = 428290b
PRODSCREENS_VERSION = e58f3a6
PRODSCREENS_SITE_METHOD = git
PRODSCREENS_SITE = https://github.com/FunKey-Project/FunKey-ProdScreens.git
PRODSCREENS_SITE_LICENSE = GPL-2.1+

View File

@ -4,7 +4,7 @@
#
################################################################################
RETROFE_VERSION = 77ccbc2
RETROFE_VERSION = bc9195f
RETROFE_SITE_METHOD = git
RETROFE_SITE = https://github.com/FunKey-Project/RetroFE.git
RETROFE_DEPENDENCIES = gstreamer1 gst1-plugins-base sdl sdl_image sdl_mixer sdl_sound sdl_ttf libglib2 sqlite zlib