That worked great, many thanks!
 
But is it possible to run this on a server without X? Headless sort of.
I've tried with unset DISPLAY and I obviously get "ERROR: Failed to open display:"
 
Regards 
-----Original Message-----
From: Peter Åstrand <astrand@cendio.se>
To: LP <lars@mute.nu>
Cc: "rdesktop-users@lists.sourceforge.net" <rdesktop-users@lists.sourceforge.net>
Date: Thu, 30 Jun 2011 11:28:55 +0200 (CEST)
Subject: Re: [rdesktop-users] Script to verify user logon under linux


Did a quick test. Modify rdp.c like this:

--- rdp.c   (revision 1630)
+++ rdp.c   (arbetskopia)
@@ -1451,6 +1451,7 @@
        case RDP_DATA_PDU_LOGON:
           DEBUG(("Received Logon PDU\n"));
           /* User logged on */
+         exit(0);
           process_pdu_logon(s);
           break;

Then, use a shell script like this:

#!/bin/sh
if timeout 20 ./rdesktop "$@"; then
     echo Successfully logged on
else
     echo Logon failed
fi


Regards,
Peter

On Thu, 30 Jun 2011, LP wrote:

>
>       Hi,
>  
> At the moment we're having a few issues with terminal servers being up and running but unable to log on.
> (This is caused by a thirdparty application and it's beeing troubleshooted as we speak)
>  
> These issues forces us to manually test if a user can log on, since our surviellance software can only detect
> if the server answers or not, but not if a user can log in or not.
>  
> Could rdesktop help me if I'd like to create some sort of script only to verify if a user can log in or not,
> returning true or false, with predefined credentials?
>  
> Best Regards
> LP
>  
>
>
>


---
Peter Åstrand      ThinLinc Chief Developer
Cendio AB      http://www.cendio.com
Wallenbergs gata 4
583 30 Linköping   Phone: +46-13-21 46 00