Run Shell Script for Mac OS X- Solved

prefetch installsh.tmp sha1:2f7ac2ebccf19dad9efa10235b2744220f1a5551 size:6388535 http://<servername>:52311/Uploads/2f7ac2ebccf19dad9efa10235b2744220f1a5551/installsh.tmp sha256:f7be04b94f155cfa5f3545a1066b59f3a3efd043e37a36f4adcafbcda31993c6

extract installsh.tmp

if {not exists folder "/Library"}
wait mkdir -p "/Library"
endif

if {not active of action OR exists file whose (name of it ends with ".tmp") of folder "__Download" of client folder of current site}
delete "{pathname of file whose (name of it ends with ".tmp") of folder "__Download" of client folder of current site}"
endif

//Copy Shell to Location:
wait mkdir -p "/Library/ShellExecuter"
move "__Download/install.sh" "/Library/ShellExecuter/install.sh"

//Execute Shell Script:

wait chmod -R 755 /Library/ShellExecuter
wait /bin/sh -c "(cd /Library/ShellExecuter/ && chmod +x install.sh)"
wait /bin/sh -c "(cd /Library/ShellExecuter/ && ./install.sh -i)"

//do some stuff after 300 seconds
parameter "start" = "{now}"
pause while {now < ( ((  parameter "start" of action  ) as time ) + 300* second)}

//Remove Shell File from the location:
wait sh -c "rm '/Library/ShellExecuter/install.sh'"
1 Like