#61405 - 2001-12-17 01:32 PM
IP Config
|
Owen
Lurker
Registered: 2001-12-17
Posts: 4
Loc: London
|
I use the following script to establish remote access users from lan users. I want to add to this so if the user has a public IP i.e not = 172.*.*.* then the script bypasses the follwoing command. Please see example.I would be most grateful if anybody could assist me. Thanks Owen ;If a RAS user then exit here!! IF @IPADDRESS0 = "172. 16. 1.210" or @IPADDRESS0 = "172. 16. 1.211" or @IPADDRESS0 = "172. 16. 1.212" or @IPADDRESS0 = "172. 16. 1.213" ? " You have dial up connection to the network" ? " You don't need to run the rest of the logon script." ? " going to exiting now... Goodbye!" SLEEP 4 ;Pause for a very long affect GOTO "END" ENDIF
|
Top
|
|
|
|
#61407 - 2001-12-17 02:21 PM
Re: IP Config
|
Owen
Lurker
Registered: 2001-12-17
Posts: 4
Loc: London
|
I don't think this answers my question?
|
Top
|
|
|
|
#61408 - 2001-12-17 02:27 PM
Re: IP Config
|
Owen
Lurker
Registered: 2001-12-17
Posts: 4
Loc: London
|
I need to pickup the specific IP as my users are not registered as RAS users within the domain.Thanks
|
Top
|
|
|
|
#61409 - 2001-12-17 02:45 PM
Re: IP Config
|
Alex.H
Seasoned Scripter
Registered: 2001-04-10
Posts: 406
Loc: France
|
Owen, In this case, you could do this :
code:
$AddressToCheck="172. 16." $IsPublic=0; For Kix3.xx, replace "for $i= ... next" with "$i=0 while $i<4 ... $i=$i+1 loop For $i=0 to 3 If left(execute("@@Ipconfig"+$i),len($AddressToCheck))=$AddressToCheck $IsPublic=1 $i=3 endif next If $IsPublic=1 ;Do your stuff endif
Note that you can directly put the "If $ispublic=1" in the "For next" part Also, this method is only working for a 255... or 255.255... subnet For a real subnet check, Bryce has a function for Kix 4.xx floating here[ 17 December 2001: Message edited by: Popovk ]
_________________________
? getobject(Kixtart.org.Signature)
|
Top
|
|
|
|
#61410 - 2001-12-17 04:14 PM
Re: IP Config
|
Owen
Lurker
Registered: 2001-12-17
Posts: 4
Loc: London
|
Thanks I'll have a look and give it a go
|
Top
|
|
|
|
#61411 - 2001-12-18 02:38 AM
Re: IP Config
|
MCA
KiX Supporter
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,It isn't necessary to use a FOR/NEXT structure. For the same result you can use an IF/ELSE/ENDIF structure.
code:
$check="172." ; format: 'xxx.xxx.xxx.xxx' f.e. '172. 16. 1.210' / '172.*.*.*' IF (Substr(@ipaddress0,1,len($check)) = $check) OR (Substr(@ipaddress1,1,len($check)) = $check) OR (Substr(@ipaddress2,1,len($check)) = $check) OR (Substr(@ipaddress3,1,len($check)) = $check) ? "skip script" ELSE ? "run script" ENDIF EXIT
greetings.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 248 anonymous users online.
|
|
|