Community Forums Today's Posts     Member List     Archive    
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    germany
    Posts
    3

    Lightbulb 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 ?!?)

    #!/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
    CONFIGURE:
    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.

  2. #2
    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

  1. TS2 Server als Service laufen lassen
    By trancempro in forum [TeamSpeak 2] Server Support
    Replies: 2
    Last Post: 21-02-2007, 16:34
  2. Ich kann den Server nur als root starten, will das aber nicht
    By NiBurhe in forum [TeamSpeak 2] Server Support
    Replies: 1
    Last Post: 18-03-2004, 21:23
  3. TS als Telefonersatz
    By washammwa in forum [TeamSpeak 2] General Questions
    Replies: 6
    Last Post: 23-01-2004, 18:19
  4. Html link funzt aber...
    By El_Labero in forum [TeamSpeak 2] Client Support
    Replies: 0
    Last Post: 01-08-2003, 13:43
  5. Channelerstellung, Mehr als 2 sind bei mir nicht drinn ;(
    By Tarbos in forum [TeamSpeak 2] Server Support
    Replies: 4
    Last Post: 14-02-2003, 07:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •