File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # This script is intended to be used as a CRON command
4+ # On my server, I use the following configuration in /etc/crontab to run it every 5 minutes:
5+ #
6+ # #minute hour mday month wday who command
7+ # */5 * * * * minecraft /usr/bin/nice /home/minecraft/CronTasks/CronDetectCheaters
8+ #
9+ # And the minecraft account home directory is the Minecraft server root.
10+
11+ . .minecraft-library
12+
13+ TEMPBAN_DURATION=3d
14+
15+ GetOnlinePlayers \
16+ | while read PLAYER
17+ do
18+ MODS=` GetForbiddenModsForPlayer $PLAYER `
19+ if [ " ${MODS} " != " " ]
20+ then echo " ${MODS} " \
21+ | tr ' ,' ' \n' \
22+ | while read MOD
23+ do
24+ MOD_DETAILS=` grep " ^${MOD} " ${FORBIDDEN_MODS_DETAILS} `
25+ MOD_NAME=` echo " ${MOD_DETAILS} " | cut -d" " -f2`
26+ SENTENCE=` echo " ${MOD_DETAILS} " | cut -d" " -f4`
27+ AddToChat " ${PLAYER} is using a forbidden mod: ${MOD_NAME} "
28+ case ${SENTENCE} in
29+ " tempban" ) ExecuteCommand " tempban ${PLAYER} ${TEMPBAN_DURATION} " ;;
30+ " ban" ) ExecuteCommand " ban ${PLAYER} for cheating" ;;
31+ " kick" ) ExecuteCommand " kick ${PLAYER} for using a forbidden mod" ;;
32+ * ) LogError " CronDetectCheaters - unknown sentence"
33+ esac
34+ done
35+ fi
36+ done
You can’t perform that action at this time.
0 commit comments