Popular Script

Locked
turkey123
Posts: 18
Joined: Wed Mar 05, 2008 2:31 pm

Popular Script

Post by turkey123 »

As per many requests:

crontab (for root)

0 0,4,8,12,16,20 * * * /usr/bin/popular.sh drop & >/dev/null 2>&1
30 3,7,11,15,19,23 * * * /usr/bin/popular.sh clear & >/dev/null 2>&1

popular.sh

#!/bin/sh
#hide_from_id.sh
#ID_SOFT1=192.246.40.0/24

ID_SOFT1=monster.idsoftware.com

case "$1" in
"drop") /sbin/iptables -A INPUT -s $ID_SOFT1 -j DROP
/sbin/iptables -A OUTPUT -d $ID_SOFT1 -j DROP
;;
*) /sbin/iptables -D INPUT -s $ID_SOFT1 -j DROP
/sbin/iptables -D OUTPUT -d $ID_SOFT1 -j DROP
;;
esac

exit 0
[root@ga1 bin]#

Also, here's a version if you want some servers to do that and others not:

#!/bin/sh
#hide_from_id.sh
#ID_SOFT1=192.246.40.0/24

ID_SOFT1=monster.idsoftware.com
EXCEPT=some.host.com or IP

case "$1" in
"drop") /sbin/iptables -I INPUT -s $EXCEPT -j ACCEPT
/sbin/iptables -A INPUT -s $ID_SOFT1 -j DROP
/sbin/iptables -A OUTPUT -d $ID_SOFT1 -j DROP
;;
*) /sbin/iptables -I INPUT -s $EXP -j ACCEPT
/sbin/iptables -D INPUT -s $ID_SOFT1 -j DROP
/sbin/iptables -D OUTPUT -d $ID_SOFT1 -j DROP
;;
esac
exit 0

How it works:

http://www.escapedturkey.com/cfaq/index ... 7&catid=24

:cool:
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Popular Script

Post by ^misantropia^ »

Haha, that's a neat trick. For the people too lazy to click on the link:
We use a special technique to make your server hide every 3.5 hours and then show itself for 30 minutes. This goes on every 4 hours. If the Quake 3 master sees your server constantly reporting, it'll eventually drop down the list to the point where you'd have to wait until you refresh most servers to see it. This technique makes the master server believe your server is new every 3.5 hours and shows up on top of the Q3 browser. It will cache your server, so it won't disappear for awhile. Eventually it does drop down after about 2.5 - 3 hours of time, but the script fires up again pushing it to the top. If this wasn't done your server would never be found in the in-game browser. Most players only refresh the first 200 or less servers.
+JuggerNaut+
Posts: 22175
Joined: Sun Oct 14, 2001 7:00 am

Re: Popular Script

Post by +JuggerNaut+ »

awesome trick
Locked