Create a fixlet which will help the user to run various types of scripts ( batch, shell ,poweshell, shell , and perl) using single fixlet on multiple OS (windows and non windows )

Hi All,

i have create a fixlet which will help the user to run various types of scripts ( batch, shell ,poweshell, shell , and perl) using single fixlet on multiple OS (windows and non windows ) my fixlet is working till windows part and i am able to genrate the files and uploading them to my main server. can anyone help to fix this non windows part please.

Fixlet Details :

begin prefetch block
add prefetch item {“name=” & parameter “strScriptName” & “.” & parameter “strScriptType” & " sha1=" & parameter “strFileSHA” & " size=" & parameter “strFileSize” & " url=http://VM172016001136:52311/uploads/" & parameter “strFileSHA” & “/” & parameter “strScriptName” & “.” & parameter “strScriptType”}
end prefetch block

action parameter query “strFileSHA” with description "Enter FileSHA"
action parameter query “strFileSize” with description "Enter FileSize"
action parameter query “strScriptType” with description "Enter Script type"
action parameter query “strScriptName” with description "Enter Script name"
action parameter query “strAlertUUID” with description "Enter ALERT UUID"
action parameter query “strFlowExecID” with description "Enter Execution ID"
action parameter query “strAttributes” with description “Enter Parameters separeated by Space”

//Set local variables and create output directories
if {(((name of operating system) as lowercase) contains “win”)}
//For Win
move “__Download{parameter “strScriptName”}.{parameter “strScriptType”}” “C:\Windows\Temp{parameter “strFlowExecID”}{parameter “strScriptName”}.{parameter “strScriptType”}"
if {“Enter Script type” = “vbs”}
dos cscript "C:\Windows\Temp{parameter “strFlowExecID”}
{parameter “strScriptName”}.{parameter “strScriptType”}” “{parameter “strFlowExecID”}” “”{parameter “strAttributes”}"“
elseif {“Enter Script type” = “bat”}
wait “C:\Windows\Temp{parameter “strFlowExecID”}{parameter “strScriptName”}.{parameter “strScriptType”}" “{parameter “strFlowExecID”}” “”{parameter “strAttributes”}""
else {“Enter Script type” = “ps1”}
waithidden “C:\Windows\SysNative\WindowsPowerShell\v1.0\PowerShell.exe” -NonInteractive -NoLogo -file "C:\Windows\Temp{parameter “strFlowExecID”}
{parameter “strScriptName”}.{parameter “strScriptType”}” “{parameter “strFlowExecID”}” “”{parameter “strAttributes”}”"
endif
setting “_BESClient_ArchiveManager_MaxArchiveSize”=“50000000” on “{parameter “action issue date” of action}” for client
setting “_BESClient_ArchiveManager_OperatingMode”=“2” on “{parameter “action issue date” of action}” for client
setting “_BESClient_ArchiveManager_FileSet-{parameter “strAlertUUID”}”=“C:\Windows\Temp{parameter “strFlowExecID”}.log” on “{parameter “action issue date” of action}” for client
setting “BESClient_ArchiveManager_SendAll"=“0” on “{parameter “action issue date” of action}” for client
archive now
delete "C:\Windows\Temp{parameter “strFlowExecID”}
{parameter “strScriptName”}.{parameter “strScriptType”}”
//delete “C:\windows\Temp{parameter “strFlowExecID”}.log”

else
//For Non-win
move “__Download{parameter “strScriptName”}.{parameter “strScriptType”}” “/tmp/{parameter “strFlowExecID”}_{parameter “strScriptName”}.{parameter “strScriptType”}”

delete __appendfile
appendfile #!/bin/sh
appendfile chmod +x /tmp/{parameter “strFlowExecID”}{parameter “strScriptName”}.{parameter “strScriptType”}"
wait chmod +x /tmp/{parameter “strFlowExecID”}
{parameter “strScriptName”}.{parameter “strScriptType”}"

setting “_BESClient_ArchiveManager_MaxArchiveSize”=“50000000” on “{parameter “action issue date” of action}” for client
setting “_BESClient_ArchiveManager_OperatingMode”=“2” on “{parameter “action issue date” of action}” for client
setting “_BESClient_ArchiveManager_FileSet-{parameter “strAlertUUID”}”=“C:\Windows\Temp{parameter “strFlowExecID”}.log” on “{parameter “action issue date” of action}” for client
setting "BESClient_ArchiveManager_SendAll"=“0” on “{parameter “action issue date” of action}” for client
archive now
delete "/tmp/{parameter “strFlowExecID”}
{parameter “strScriptName”}.{parameter “strScriptType”}"
endif