scripts/start.sh aktualisiert
This commit is contained in:
@@ -12,11 +12,11 @@ cp -f /opt/custom/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
|
|||||||
cp -f /opt/scripts/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
|
cp -f /opt/scripts/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
|
||||||
|
|
||||||
if [ -f /opt/scripts/start-user.sh ]; then
|
if [ -f /opt/scripts/start-user.sh ]; then
|
||||||
echo "---Found optional script, executing---"
|
echo "---Found optional script, executing---"
|
||||||
chmod -f +x /opt/scripts/start-user.sh ||:
|
chmod -f +x /opt/scripts/start-user.sh ||:
|
||||||
/opt/scripts/start-user.sh || echo "---Optional Script has thrown an Error---"
|
/opt/scripts/start-user.sh || echo "---Optional Script has thrown an Error---"
|
||||||
else
|
else
|
||||||
echo "---No optional script found, continuing---"
|
echo "---No optional script found, continuing---"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "---Taking ownership of data...---"
|
echo "---Taking ownership of data...---"
|
||||||
@@ -26,14 +26,16 @@ chown -R ${UID}:${GID} ${DATA_DIR}
|
|||||||
|
|
||||||
echo "---Starting...---"
|
echo "---Starting...---"
|
||||||
term_handler() {
|
term_handler() {
|
||||||
if [ -f ${SERVER_DIR}/Engine/Binaries/Linux/UE4Server-Linux-Shipping ]; then
|
if [ -f ${SERVER_DIR}/Engine/Binaries/Linux/UE4Server-Linux-Shipping ]; then
|
||||||
KILLPID=$(pidof UE4Server-Linux-Shipping)
|
KILLPID=$(pidof UE4Server-Linux-Shipping)
|
||||||
elif [ -f ${SERVER_DIR}/Engine/Binaries/Linux/UnrealServer-Linux-Shipping ]; then
|
elif [ -f ${SERVER_DIR}/Engine/Binaries/Linux/UnrealServer-Linux-Shipping ]; then
|
||||||
KILLPID=$(pidof UnrealServer-Linux-Shipping)
|
KILLPID=$(pidof UnrealServer-Linux-Shipping)
|
||||||
fi
|
elif [ -f ${SERVER_DIR}/Engine/Binaries/Linux/FactoryServer-Linux-Shipping ]; then
|
||||||
kill -SIGINT $KILLPID
|
KILLPID=$(pidof FactoryServer-Linux-Shipping)
|
||||||
tail --pid=$KILLPID -f 2>/dev/null
|
fi
|
||||||
exit 143;
|
kill -SIGINT $KILLPID
|
||||||
|
tail --pid=$KILLPID -f 2>/dev/null
|
||||||
|
exit 143;
|
||||||
}
|
}
|
||||||
|
|
||||||
trap 'kill ${!}; term_handler' SIGTERM
|
trap 'kill ${!}; term_handler' SIGTERM
|
||||||
@@ -41,6 +43,6 @@ su ${USER} -c "/opt/scripts/start-server.sh" &
|
|||||||
killpid="$!"
|
killpid="$!"
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
wait $killpid
|
wait $killpid
|
||||||
exit 0;
|
exit 0;
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user