#24864 - 2002-07-11 09:26 PM
Re: Drive mapping according to server name or IP address?
|
Dax
Fresh Scripter
Registered: 2002-01-04
Posts: 8
Loc: Mid West
|
Your replys have been very infomative, so thank you.
Here is what I've tried today:
IF @IPADDRESS0 = " 10. 1. *. *" USE m: "\\gbtsrv01\users"
If @IPADDRESS0 = " 10. 2. *. *" USE n: "\\gbtsrv02\users"
ENDIF
and no luck, and suggestions? [ 11 July 2002, 21:28: Message edited by: Dax ]
_________________________
Everything is okay in the end. If it's not okay, then it's not the
end.
|
|
Top
|
|
|
|
#24865 - 2002-07-11 09:33 PM
Re: Drive mapping according to server name or IP address?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
DAX,
Every IF has to have an ENDIF
code:
IF @IPADDRESS0 = " 10. 1. *. *" USE m: "\\gbtsrv01\users" ENDIF
If @IPADDRESS0 = " 10. 2. *. *" USE n: "\\gbtsrv02\users" ENDIF
Suggestion, you want to clean up the IP addressess using the following FAQ and specifically - IP Address Trimming.
HTH,
Kent
|
|
Top
|
|
|
|
#24867 - 2002-07-11 09:38 PM
Re: Drive mapping according to server name or IP address?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Les,
You are right..
I was really trying to focus on the IP Address Trimming..
Kent
|
|
Top
|
|
|
|
#24869 - 2002-07-11 09:46 PM
Re: Drive mapping according to server name or IP address?
|
Dax
Fresh Scripter
Registered: 2002-01-04
Posts: 8
Loc: Mid West
|
Thank you for the quick reply, but... I still dont understand. I'm sorry for sounding so stupid, I know nothing of scripting, and the triming doesnt make sense, where am I to put my IP information in the Trimming code?
Here is what I now have:
;LTRIM - TRIM THE LEADING SPACES FROM A STRING ;SUBSTR - RETURNS PART OF STRING: START POSITION, LENGTH $1st = LTRIM(SUBSTR(@ipaddress0, 1, 3)) ; #ip# $2nd = LTRIM(SUBSTR(@ipaddress0, 5, 3)) ; #ip# Get the IP# and assign it to $ipadr $3rd = LTRIM(SUBSTR(@ipaddress0, 9, 3)) ; #ip# $4th = LTRIM(SUBSTR(@ipaddress0, 13, 3)) ; #ip# $ipadr = "$1ST.$2ND.$3RD.$4TH" ; #ip#
IF @IPADDRESS0 = " 10. 1. *. *" USE M: "\\gbtsrv01\users" ENDIF If @IPADDRESS0 = " 10. 2. *. *" USE N: "\\gbtsrv02\users" ENDIF
_________________________
Everything is okay in the end. If it's not okay, then it's not the
end.
|
|
Top
|
|
|
|
#24872 - 2002-07-11 09:59 PM
Re: Drive mapping according to server name or IP address?
|
Dax
Fresh Scripter
Registered: 2002-01-04
Posts: 8
Loc: Mid West
|
Would this work better?
IF @LSERVER = "gbtsrv01" USE m: "\\gbtsrv01\users" ENDIF If @LSERVER = "gbtsrv02" USE n: "\\gbtsrv02\users" ENDIF
_________________________
Everything is okay in the end. If it's not okay, then it's not the
end.
|
|
Top
|
|
|
|
#24874 - 2002-07-11 10:01 PM
Re: Drive mapping according to server name or IP address?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Dax,
That would be a matter of preference..
What is m: and n: ?
If these are user's home drives, you may want to use IF INGROUP. If they are application drives, no problem.
Thanks,
Kent
|
|
Top
|
|
|
|
#24878 - 2002-07-11 11:13 PM
Re: Drive mapping according to server name or IP address?
|
Dax
Fresh Scripter
Registered: 2002-01-04
Posts: 8
Loc: Mid West
|
Your right LLigetfa, the @lserver will not garantee the right server.
Will this code still need UDF functions to go along with it? And do I need the spacing in my IP addresses, or can I type them in normal?
code:
SELECT CASE (@IPADDRESS0 >= "10. 1. 1. 0") AND (@IPADDRESS0 < "10. 1. 1.255") $Vpn =
"No" CASE (@IPADDRESS0 >= "10. 2. 1. 0") AND (@IPADDRESS0 < "10. 2. 1.255") $Vpn =
"No" CASE (1) $Vpn = "Yes" ENDSELECT
IF ($Vpn = "No") CALL "iowafalls.kix" ELSE CALL "ackley.kix" ENDIF
_________________________
Everything is okay in the end. If it's not okay, then it's not the
end.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1179 anonymous users online.
|
|
|