Results 1 to 2 of 2
Thread: Userliste als html mit *nix/bsd
Hybrid View
-
09-11-2002, 20:17 #1
-= TeamSpeak User =-
- Join Date
- Nov 2002
- Location
- germany
- Posts
- 3
Userliste als html mit *nix/bsd
well, since my TS Server somehow doesnt post anything to my webpost2 script here a small solution for a Userlist at least.
The following shell script saved as tsstatus.cgi in your webserver´s cgi-bin folder should do the trick: (if u have netcat installed, but who hasnt ?!?)
CONFIGURE:#!/bin/sh
#
# Teamspeak 2 - CGI Username Query
#
# (c) Martin Hauck 2002
#
PLY=`{ echo "sel 8767"; echo "pl 8767"; echo "quit"; } | /usr/local/bin/netcat localhost 51234`
COUNT=3
echo "Content-Type: text/html; charset=iso-8859-1"
echo "Cache-control: no-store" # HTTP/1.1 (or no-cache?)
echo "Pragma: no-cache" # HTTP/1.0
echo "Expires: `date -Ru`" # Expires now!
echo "Refresh: 30"
echo
echo "<html><head>"
echo "<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"main.css\">"
echo "<title>Teamspeak Users</title></head>"
echo "<body bgcolor=\"#ffffff\" text=\"BLACK\" background=\"Background.jpg\">"
echo "<div align=\"center\">"
echo "<table border="1">"
if [ "$(echo $PLY | cut -d" " -f$COUNT)" = "OK" ]
then
echo "</table>"
echo "<br><br><small>no one connected..</small>"
echo "</body></html>"
exit 0
else
COUNT=`expr "$COUNT" + 1`
while [ "$(echo $(echo $PLY | cut -d"." -f$COUNT) | cut -d" " -f2)" != "OK" ]
do
echo "<tr><td>$(echo $(echo $PLY | cut -d"." -f$COUNT) | cut -d" " -f2)</td></tr>"
COUNT=`expr "$COUNT" + 3`
done
fi
echo "</table>"
echo "</div>"
echo "<br><small>userlisting v0.9<br>(c)Mad 2002</small>"
echo "</body></html>"
exit 0
Just use your serveradress and queryport and maybe the server udpport used for the pl command.
So it has nothing to do with the webpost feature of the server; in fact it does directly query the server everytime its hit, so you have always the correct data shown up.
See it in Action here.
I display the cgi in an IFRAME under the left menue.
-
10-11-2002, 14:21 #2
-= TeamSpeak User =-
- Join Date
- Aug 2002
- Location
- Wageningen,NL
- Posts
- 13
The pl 8767 isn't needed after a sel 8767...
For the rest :
I'm impressed by the easy solution. I was using difficult telnet parsing, this is a lot easier.
I think I'll rewrite my script to use netcat.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
TS2 Server als Service laufen lassen
By trancempro in forum [TeamSpeak 2] Server SupportReplies: 2Last Post: 21-02-2007, 16:34 -
Ich kann den Server nur als root starten, will das aber nicht
By NiBurhe in forum [TeamSpeak 2] Server SupportReplies: 1Last Post: 18-03-2004, 21:23 -
TS als Telefonersatz
By washammwa in forum [TeamSpeak 2] General QuestionsReplies: 6Last Post: 23-01-2004, 18:19 -
Html link funzt aber...
By El_Labero in forum [TeamSpeak 2] Client SupportReplies: 0Last Post: 01-08-2003, 13:43 -
Channelerstellung, Mehr als 2 sind bei mir nicht drinn ;(
By Tarbos in forum [TeamSpeak 2] Server SupportReplies: 4Last Post: 14-02-2003, 07:32


Reply With Quote