ich versuche gerade aus 5 Produkten eines zu machen.
Ich möchte - abhängig vom Depot, dem der Computer zugeordnet ist - Desktop-Inhalte verteilen.
Der Teil des Scripts, an dem ich gerade hänge sieht so aus:
Code: Alles auswählen
comment "copying"
Message "Wir richten gerade Desktopverknüpfungen ein."
comment "Copy desktop-files"
;----------------------------------------------
if %opsiDepotId% = "opsidepot-hamburg.opsi.intern.zz"
Files_copy_hamburg
else
if %opsiDepotId% = "opsidepot-lans.opsi.intern.zz"
Files_copy_lans
else
if %opsiDepotId% = "opsidepot-london.opsi.intern.zz"
Files_copy_london
else
if %opsiDepotId% = "opsidepot-sylt.opsi.intern.zz"
Files_copy_sylt
else
if %opsiDepotId% = "opsi.intern.zz"
Files_copy_tegernsee
endif
(170) [6] [2022-10-07 09:30:27.362] [desktop-copy] <<< syntax error, no result!! - set to false
(171) [2] [2022-10-07 09:30:27.362] [desktop-copy] Syntax Error in Section: Actions (Command in line 1169 in section: Actions; file: setup.opsiscript; section start at line: 8; origin: setup.opsiscript; line: 1169): opsi.intern.zz = "opsidepot-hamburg.opsi.intern.zz" -> "opsi.intern.zz = "opsidepot-hamburg.opsi.intern.zz"" is an illegal String Expressionstr
(172) [2] [2022-10-07 09:30:27.362] [desktop-copy] Syntax Error in Section: Actions (Command in line 1169 in section: Actions; file: setup.opsiscript; section start at line: 8; origin: setup.opsiscript; line: 1169): opsi.intern.zz = "opsidepot-hamburg.opsi.intern.zz" -> erroneous characters
(173) [6] [2022-10-07 09:30:27.362] [desktop-copy] Then
(174) [2] [2022-10-07 09:30:27.362] [desktop-copy] Syntax Error in Section: Actions (Command in line 1170 in section: Actions; file: setup.opsiscript; section start at line: 8; origin: setup.opsiscript; line: 1170): EndIf -> expected
(175) [1] [2022-10-07 09:30:27.362] [desktop-copy] ___________________
(176) [1] [2022-10-07 09:30:27.362] [desktop-copy] script finished: failed
Also er findet den Wert opsi.intern.zz für %opsiDepotId%.
Das passt ja. Aber er vergleicht nur mit dem ersten Block und eht nicht weiter zu den else-Bedingungen.
Daraus ergeben sich zwei Fragen:
1.) Wie prüfe ich richtig auf das Depot?
und
2.) Wie wird die komplette Liste durchlaufen bis der Interpreter zum gültigen Wert kommt?
Danke!