elpopper
21-05-2008, 04:20
Hi all,
I have been searching through the forums for some general sql (mysql information), but I haven't found anything useful.
I am writing some unix shell scripts that use mysql to alter the database directly.
My far-fetched goal is to create an anti-flood shell script, so that i won't need to use tcpquery.
I finished the shortest part of my script, the one that inserts the bans in the ts2_bans table. Here is the code it uses:
$i is an auto-incrementing variable which starts from the biggest index+5
$sor is the server id
$ban holds the ip to be banned
$nev holds the name who created the ban
$tim is created using the date +%d%m%Y%H%M%S with 000 on it's end (here is something i want to ask)
$ido is the time(in minutes) for how long the ban will last.
INSERT INTO ts2.ts2_bans (i_ban_id,i_ban_server_id,s_ban_ip,s_ban_by,dt_ban _created,i_ban_minutes) VALUES('$i','$sor','$ban','$nev','$tim','$ido')
The script works flawlessly, it inserts the required records in the table BUT
here is the problem:
If i add my own ip i can still go on the server. I can't see the ban in the banlist, until i add a ban manually, and still i will be able to join the server with the banned IP.
Here is the line that my manual ban inserts:
0 1 167.231.*.* IP Ban Popper[LoginName: popper] 21052008033642859 0
and here is the one that my script does:
107 53 157.181.184.35 MYSQL 21052008033559000 0
The only main difference is the last three numbers of the time of the ban's creation, which i could not figure out what it stood for (if someone knows please tell)
So, if i "inject" a ban directly into the sql table, than it won't work? Or i have to "force" the server to re-read the sql table ts2_bans? If so than how?
I hope that someone understands my foolish problem and helps me out :)
I have been searching through the forums for some general sql (mysql information), but I haven't found anything useful.
I am writing some unix shell scripts that use mysql to alter the database directly.
My far-fetched goal is to create an anti-flood shell script, so that i won't need to use tcpquery.
I finished the shortest part of my script, the one that inserts the bans in the ts2_bans table. Here is the code it uses:
$i is an auto-incrementing variable which starts from the biggest index+5
$sor is the server id
$ban holds the ip to be banned
$nev holds the name who created the ban
$tim is created using the date +%d%m%Y%H%M%S with 000 on it's end (here is something i want to ask)
$ido is the time(in minutes) for how long the ban will last.
INSERT INTO ts2.ts2_bans (i_ban_id,i_ban_server_id,s_ban_ip,s_ban_by,dt_ban _created,i_ban_minutes) VALUES('$i','$sor','$ban','$nev','$tim','$ido')
The script works flawlessly, it inserts the required records in the table BUT
here is the problem:
If i add my own ip i can still go on the server. I can't see the ban in the banlist, until i add a ban manually, and still i will be able to join the server with the banned IP.
Here is the line that my manual ban inserts:
0 1 167.231.*.* IP Ban Popper[LoginName: popper] 21052008033642859 0
and here is the one that my script does:
107 53 157.181.184.35 MYSQL 21052008033559000 0
The only main difference is the last three numbers of the time of the ban's creation, which i could not figure out what it stood for (if someone knows please tell)
So, if i "inject" a ban directly into the sql table, than it won't work? Or i have to "force" the server to re-read the sql table ts2_bans? If so than how?
I hope that someone understands my foolish problem and helps me out :)