1
0
mirror of synced 2025-12-18 13:22:16 +01:00

Add ps3netsrv

This commit is contained in:
d-two
2022-12-22 19:43:59 +01:00
committed by GitHub
parent 26188fc9f7
commit 3114c918a1
17 changed files with 1145 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
USER_ID=${USER_ID:-1000}
GROUP_ID=${GROUP_ID:-1000}
groupmod -o -g "$GROUP_ID" ps3netsrv
usermod -o -u "$USER_ID" ps3netsrv
echo '
-------------------------------------
GID/UID
-------------------------------------'
echo "
User uid: $(id -u ps3netsrv)
User gid: $(id -g ps3netsrv)
-------------------------------------
"
mkdir -p /share/ps3netsrv

View File

@@ -0,0 +1 @@
oneshot

View File

@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-ps3netsrv/run

View File

@@ -0,0 +1,26 @@
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Ps3NetSrv
# Take down the S6 supervision tree when ps3netsrv fails
# ==============================================================================
declare exit_code
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode)
readonly exit_code_service="${1}"
readonly exit_code_signal="${2}"
readonly service="Ps3NetSrv"
bashio::log.info \
"Service ${service} exited with code ${exit_code_service}" \
"(by signal ${exit_code_signal})"
if [[ "${exit_code_service}" -eq 256 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo $((128 + $exit_code_signal)) > /run/s6-linux-init-container-results/exitcode
fi
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt
elif [[ "${exit_code_service}" -ne 0 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo "${exit_code_service}" > /run/s6-linux-init-container-results/exitcode
fi
exec /run/s6/basedir/bin/halt
fi

View File

@@ -0,0 +1,9 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: Ps3NetSrv
# Runs the ps3netsrv
# ==============================================================================
bashio::log.info "Starting Ps3NetSrv...."
/usr/local/bin/ps3netsrv /share/ps3netsrv

View File

@@ -0,0 +1 @@
longrun