-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion - open and close firewall #239
Comments
This is not a bad idea, but I wonder if it would be better to implement something like this in the properties files? E.g.:
That would allow for much more customization than hard coding something in to the script. |
Either this or allow launching another script |
That is essentially what I am suggesting with the prestart/poststop commands. However, alternatively we can just update the documentation to mention that something like this is possible*:
*We should verify that this works |
That works too, the only advantage I can see with having a separate config option is that it makes it more obvious if someone is looking for the functionality |
Actually, modifying the server-command as I suggested above does not work -- It breaks the I think moving forward, the best option would be to add |
In
/etc/sudoers
User privilege specification
root ALL=(ALL) ALL
minecraft ALL=NOPASSWD:/usr/bin/firewall-cmd --add-port=25565/tcp
minecraft ALL=NOPASSWD:/usr/bin/firewall-cmd --remove-port=25565/tcp
msctl file
around line 2426
# Start each world requested, if not already running.
printf "Starting Minecraft Server:"
for WORLD in $WORLDS; do
if ! serverRunning $WORLD; then
printf " $WORLD"
start $WORLD
fi
#sudo /usr/bin/firewall-cmd --add-port=$PORT/tcp
sudo /usr/bin/firewall-cmd --add-port=25565/tcp
done
and
line 2469
sendCommand $WORLD "save-all"
sendCommand $WORLD "save-off"
if [ "$COMMAND" = "force-stop" ]; then
forceStop $WORLD
else
stop $WORLD
fi
elif [ "$COMMAND" = "force-stop" ]; then
printf " $WORLD"
forceStop $WORLD
fi
#sudo /usr/bin/firewall-cmd --remove-port=$PORT/tcp
sudo /usr/bin/firewall-cmd --remove-port=25565/tcp
done
The text was updated successfully, but these errors were encountered: