[Solved] Function IP address
[Solved] Function IP address
HI Everyone,
I want to create an installation rule based on the IP address of the machine for put a different CD key for each society.
Is there a method to retrieve the IP in a variable so you can call after?
Thx
Regards,
I want to create an installation rule based on the IP address of the machine for put a different CD key for each society.
Is there a method to retrieve the IP in a variable so you can call after?
Thx
Regards,
Zuletzt geändert von nirale33 am 31 Jan 2014, 15:42, insgesamt 1-mal geändert.
Re: Function IP address
HI,
opsi-winst knows the constant
%IPAddress%
and the Functions:
getMyIpByTarget
and
GetIpByName
Often is this the best way:
gives you the IP of the Interface that is used to communicate with the opsi server.
see:
download.uib.de/opsi_stable/doc/html/en ... anual.html
regards
d.oertel
opsi-winst knows the constant
%IPAddress%
and the Functions:
getMyIpByTarget
and
GetIpByName
Often is this the best way:
Code: Alles auswählen
set $CompValue$ = getMyIpByTarget("%opsiServer%")
see:
download.uib.de/opsi_stable/doc/html/en ... anual.html
regards
d.oertel
Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.
Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.
uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de
Re: Function IP address
Thx for your reply
I'm almost there, but I've a problème, I want "cut" my IP for select only the second byte.
There are many subnet (10.78.*.* , 10.80.*.* ...) and one licence key for each subnet.
IP client : 10.78.1.5
I want to compare the second byte with some I've already filled at the beginning of my script.
My script is :
The red part returns an error
I'm almost there, but I've a problème, I want "cut" my IP for select only the second byte.
There are many subnet (10.78.*.* , 10.80.*.* ...) and one licence key for each subnet.
IP client : 10.78.1.5
I want to compare the second byte with some I've already filled at the beginning of my script.
My script is :
Code: Alles auswählen
[Actions]
Message "F-Secure setup"
SetLogLevel=6
DefVar $IPAddress$
DefVar $IPpart$
DefVar $Ent1$
DefVar $IPtotal$
Set $IPtotal$=$IPAddress$
[color=#FF0000]Set $IPpart$=getSubList(3: 2, $IPtotal$)[/color]
Set $Ent1$="87"
if ($IPpart$ =$Ent1$)
sub_install
else
stop "Failled"
endif
The red part returns an error
Re: Function IP address
Yeah it works with this script.
Now I can attribute an CD key for each society
Now I can attribute an CD key for each society

Code: Alles auswählen
[Actions]
Message "F-Secure setup"
SetLogLevel=6
DefVar $CompValue$
DefVar $Ent1$
set $CompValue$=getMyIpByTarget("%opsiServer%") > Find the computer IP address
Set $Ent1$="87" > We are in A class IP (10.87.*.*)
if contains($CompValue$, $Ent1$) > Find if in my IP there is the number 87
sub_install
else
stop "Failled"
endif