From owner-freebsd-ports@FreeBSD.ORG Sun Nov 9 08:39:43 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A15EE16A4CE for ; Sun, 9 Nov 2003 08:39:43 -0800 (PST) Received: from moe.tera-byte.com (moe.tera-byte.com [216.194.64.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9F1543FA3 for ; Sun, 9 Nov 2003 08:39:40 -0800 (PST) (envelope-from escapedturkey@escapedturkey.com) Received: from escapedturkey.com (localhost.localdomain [127.0.0.1]) (authenticated (0 bits)) by moe.tera-byte.com (8.11.6/8.11.6) with ESMTP id hA9Gder17093 for ; Sun, 9 Nov 2003 09:39:40 -0700 Received: from 4.8.14.76 (SquirrelMail authenticated user escapedturkey@escapedturkey.com) by www.escapedturkey.com with HTTP; Sun, 9 Nov 2003 09:39:40 -0700 (MST) Message-ID: <4595.4.8.14.76.1068395980.squirrel@www.escapedturkey.com> Date: Sun, 9 Nov 2003 09:39:40 -0700 (MST) From: To: X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.11) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: KKrcon should be in ports =) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2003 16:39:43 -0000 It's a great utility for game hosts like myself, who run game servers. I use it all the time for scripts. http://kkrcon.sourceforge.net/ To get it working properly, the following files must be placed in the following locations: /usr/libdata/perl/5.00503/KKrcon.pm /usr/bin/kkrcon.pl I use the following script, for example, checks server status every 10 minutes: #!/bin/sh tf1="temp1" kkrcon.pl -a instertserverip -p insertserverport -t old insertrconpassword status > $tf1 # total number of lines in output tnl=`wc $tf1 | awk '{print $1}' ` # tnl=1 - server doesnt respond. crash/wrong ip/port # tnl=2 - bad password # tnl=5 - server empty if [ "$tnl" -le 1 ]; then sleep 30 # lets try again, in case server was restarting map kkrcon.pl -a insertserverip -p insertserverport -t old insertrconpassword status > $tf1 tnl=`wc $tf1 | awk '{print $1}' ` if [ "$tnl" -le 1 ]; then # no. server is really down serverpid=`ps auxw | grep serverstartfilenamehere | grep -v grep | awk '{print $2}'` if [ -z "$serverpid" ]; then cd ~/serverstartupfolderhere ./serverstartcommandlinehere else kill $serverpid sleep 10 cd ~/serverstartupfolderhere ./serverstartcommandlinehere fi fi fi #EOF