#!/usr/bin/perl ################################################################################ # Date: 10/29/2003 # File: ass.pl # By: Who Dah? # For: ASS project - www.clantaco.com/ASS/ # Requirements: Socket, Time::HiRes # Objective: auto-update pb ban file provided & updated by quake community. # designed to be added to a cron job. i use cron.daily myself to # autoupdate the ASS list once each day. i've also symlinked my # sv_cheat.log and sv_viol.log so the ASS team can dl them at will to # update the master ASS list. # Variables: 5 variables, see VARIABLES below and set accordingly ################################################################################ # rcon any command - originally written by ronr ###################### Usage ################################################### use Socket; use Time::HiRes qw(time alarm sleep); # VARIABLES $pb_FSPATH = "/home/q3/MS-CTFS/pb"; # no trailing slash, FULL path to working pb dir $dat_path = "http://www.toomanychoices.com/pblist/server_admins/ass_pbbans.dat"; $rconip = "207.44.153.199"; $rconport = "27960"; $rconpass = "PASSWORD"; # YOU SHOULD NOT HAVE TO EDIT ANYTHING BELOW THIS POINT # retrieve ass_pbbans.dat file $wget_output = `wget -O $pb_FSPATH/ass_pbbans.dat $dat_path`; # issue rcon to update the ban list # 1 - empty ban list # 2 - load server's ban list # 3 - load ASS ban list $dest = sockaddr_in ($rconport, inet_aton($rconip)); socket (QT, PF_INET, SOCK_DGRAM, $proto) || die $!; connect (QT, $dest) || die $!; $data = "\xff\xff\xff\xffrcon $rconpass pb_sv_banempty\x00"; send (QT, $data, 0); sleep 3; # must pause between rcon's due to buffer protection introducted in PR 1.27 $data = "\xff\xff\xff\xffrcon $rconpass pb_sv_banload\x00"; send (QT, $data, 0); sleep 3; # must pause between rcon's due to buffer protection introducted in PR 1.27 $data = "\xff\xff\xff\xffrcon $rconpass pb_sv_banload $pb_FSPATH/ass_pbbans.dat\x00"; send (QT, $data, 0); close (QT); exit(0);