I need to be able to start up a screen without connecting to it, but it also needs to run my start.sh script which contains the java line to start Minecraft.
screen -d -m new3 -c start.sh
Is what I've been trying to use, but it never runs start.sh
In a snippet of code I found on line it seems to do what I want but I need some help
mc_start() {
cd $MCPATH
as_user "cd $MCPATH && screen -dmS $SCREEN $INVOCATION"
#
# Waiting for the server to start
#
seconds=0
until ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
do
sleep 1
seconds=$seconds+1
if [[ $seconds -eq 5 ]]
then
echo "Still not running, waiting a while longer..."
fi
if [[ $seconds -ge 120 ]]
then
echo "Failed to start, aborting."
exit 1
fi
done
echo "$SERVICE is running."
}