Hamster-Scripts: Functions (Hamster): RAS


HamRasDial( <name>, <user>, <pass> )
HamRasDial( <name> )

Dials the RAS-connection named "<name>" and tries to authenticate with username <user> and password <pass> (if given).

If <user> and/or <pass> is omitted or set to empty strings (""), the settings of "HamSetLogin" (if any) or the values stored in Hamster are used to establish the connection. This function also supports one of the stored "general-purpose"-passwords to avoid noting it in clear-text in the script (<user>="$(number), <pass>="").

NOTE: If this function is used, "HamRasHangup" should be used to terminate the connection again.

Returns: 0=OK/connected; >0=error-code; -1=RAS not installed

$try = 1
while( HamRasDial( "MyProvider","$42" ) != 0 )
   if( $try >= 3 )
      error( "Dialing failed!" )
   inc( $try )
   sleep( 10000 )


Terminates an existing RAS-connection.

Returns: 0: OK; >0: error-code; -1: RAS not installed


[www.elbiah.de Hamster Playground Documentation]