2024-06-22 22:53:04 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2024-07-07 15:04:22 +08:00
|
|
|
umask "$UMASK"
|
2024-06-22 22:53:04 +08:00
|
|
|
|
2024-07-07 15:04:22 +08:00
|
|
|
if [ "$(id -u)" != "0" ]; then
|
|
|
|
echo "Skipped changing user and group because current user is not root."
|
|
|
|
exec dotnet /app/BililiveRecorder.Cli.dll "$@"
|
|
|
|
fi
|
2024-06-22 22:53:04 +08:00
|
|
|
|
2024-07-07 15:04:22 +08:00
|
|
|
PUID=${PUID:-0}
|
|
|
|
PGID=${PGID:-0}
|
2024-06-22 22:53:04 +08:00
|
|
|
|
2024-07-07 15:04:22 +08:00
|
|
|
if [ "${PUID}" != "0" ] && [ "${PGID}" != "0" ]; then
|
|
|
|
chown -R "${PUID}":"${PGID}" /rec
|
|
|
|
exec /usr/local/bin/gosu "${PUID}":"${PGID}" dotnet /app/BililiveRecorder.Cli.dll "$@"
|
|
|
|
else
|
|
|
|
exec dotnet /app/BililiveRecorder.Cli.dll "$@"
|
|
|
|
fi
|