Compare commits
10 commits
Author | SHA1 | Date | |
---|---|---|---|
08c563b398 | |||
049866de88 | |||
9b8cf7eb57 | |||
c3b3dc9ea8 | |||
be26cd6a5d | |||
e5b600de1d | |||
3256647585 | |||
6e15159ca6 | |||
4a0e206f09 | |||
14adfefa61 |
5 changed files with 16 additions and 23 deletions
|
@ -2,7 +2,7 @@
|
|||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH
|
||||
|
||||
# Start the Minecraft server after an OS reboot
|
||||
@reboot su kaboom -c '~/framework/script/init.sh'
|
||||
@reboot su infinite -c '~/framework/script/init.sh'
|
||||
|
||||
# Reset and reboot the server every 24 hours (0 0 * * * / at 00:00)
|
||||
0 0 * * * su kaboom -c '~/framework/script/reset.sh && ~/framework/script/init.sh'
|
||||
0 0 * * * su infinite -c '~/framework/script/reset.sh && ~/framework/script/init.sh'
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# IPv4
|
||||
iptables -t nat -A INPUT -p tcp --dport 25565 -j SNAT --to-source 192.168.1.0-192.168.100.100
|
||||
iptables -t nat -A INPUT -p udp --dport 19132 -j SNAT --to-source 192.168.1.0-192.168.100.100
|
||||
iptables -A INPUT -p tcp --syn --dport 25565 -m connlimit --connlimit-above 5 --connlimit-mask 32 -j REJECT --reject-with tcp-reset
|
||||
iptables-save > /etc/iptables/rules.v4
|
||||
iptables -t nat -A INPUT -p tcp --dport 27801 -j SNAT --to-source 192.168.1.0-192.168.100.100
|
||||
iptables -A INPUT -p tcp --syn --dport 27801 -m connlimit --connlimit-above 5 --connlimit-mask 32 -j REJECT --reject-with tcp-reset
|
||||
iptables-save > /etc/iptables/rules-save
|
||||
|
||||
# IPv6
|
||||
ip6tables -t nat -A INPUT -p tcp --dport 25565 -j SNAT --to-source 2001:db8::1-2001:db8::6464
|
||||
ip6tables -t nat -A INPUT -p udp --dport 19132 -j SNAT --to-source 2001:db8::1-2001:db8::6464
|
||||
ip6tables -A INPUT -p tcp --syn --dport 25565 -m connlimit --connlimit-above 5 --connlimit-mask 64 -j REJECT --reject-with tcp-reset
|
||||
ip6tables-save > /etc/iptables/rules.v6
|
||||
ip6tables -t nat -A INPUT -p tcp --dport 27801 -j SNAT --to-source 2001:db8::1-2001:db8::6464
|
||||
ip6tables -A INPUT -p tcp --syn --dport 27801 -m connlimit --connlimit-above 5 --connlimit-mask 64 -j REJECT --reject-with tcp-reset
|
||||
ip6tables-save > /etc/iptables/rules6-save
|
||||
|
|
|
@ -10,7 +10,7 @@ while true; do
|
|||
|
||||
# If the server doesn't respond to ping, kill it
|
||||
|
||||
if [ "$(env printf '\xFE' | nc -w 15 0.0.0.0 25565 | wc -m)" -eq 0 ]; then
|
||||
if [ "$(env printf '\xFE' | nc -w 15 0.0.0.0 27801 | wc -m)" -eq 0 ]; then
|
||||
pkill -9 java
|
||||
echo $(date) >> ~/kill.log
|
||||
else
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
# checker in the background
|
||||
|
||||
cd ~/
|
||||
rm kaboom schematics
|
||||
rm infinite schematics
|
||||
|
||||
while true; do
|
||||
dtach -n kaboom ~/framework/script/server.sh > /dev/null 2>&1
|
||||
dtach -n schematics ~/framework/script/schematics.sh > /dev/null 2>&1
|
||||
dtach -n infinite ~/framework/script/server.sh > /dev/null 2>&1
|
||||
# dtach -n schematics ~/framework/script/schematics.sh > /dev/null 2>&1
|
||||
sleep 5
|
||||
done &
|
||||
|
|
|
@ -23,18 +23,12 @@ while true; do
|
|||
|
||||
# Make certain files and folders read-only
|
||||
|
||||
mkdir debug/ dumps/ plugins/update/
|
||||
chmod -R 500 debug/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/update/
|
||||
chmod 500 plugins/
|
||||
chmod 400 bukkit.yml
|
||||
chmod 400 commands.yml
|
||||
mkdir debug/ dumps/
|
||||
chmod -R 500 debug/ dumps/
|
||||
chmod 500 mods/
|
||||
chmod 400 eula.txt
|
||||
chmod 400 paper.yml
|
||||
chmod 400 permissions.yml
|
||||
chmod 400 server-icon.png
|
||||
chmod 400 server.properties
|
||||
chmod 400 spigot.yml
|
||||
chmod 400 wepif.yml
|
||||
|
||||
# Start alive checker
|
||||
|
||||
|
@ -73,6 +67,7 @@ while true; do
|
|||
-DIReallyKnowWhatIAmDoingISwear \
|
||||
-Dusing.aikars.flags=https://mcflags.emc.gs \
|
||||
-Daikars.new.flags=true \
|
||||
-Dlog4j.configurationFile=log4j2_112-116.xml \
|
||||
-jar server.jar nogui
|
||||
|
||||
# Stop alive checker (will be started again on the next run)
|
||||
|
|
Loading…
Reference in a new issue