Peter Thorn Posted November 29, 2022 Posted November 29, 2022 I am trying to check if an application (forticlient) is installed via the Requirement script below. I would like to use exit code - 220, as there is no need for the fileset to try again and again if it has failed (as I read it would be if I use exit -1. However, it doesn't seem to work - it tries to install no matter. I have tried using both "exit - 220" (as I read the description says) and "exit -220". Am I using it wrong? Thanks, Peter #!/bin/bash # For all script types, returning an exit code of 0 (success) means the # script execution completed successfully. # # Requirements scripts can have the following exit codes that # influence how the Client will handle the Fileset: # # - 210: This exit code will cause the Fileset to be treated like the # installation was successful (unless another requirements script fails,) # but the Fileset will not be downloaded nor installed. # # - 220: This exit code will prevent the installation and cause the client to # stop retrying unless a manual action is made (verify, reinstall, etc.) # or the Fileset is updated. # # Returning any other exit code but 0 (e.g. 1 or -1) will be reported as a # "Requirements Failure: Script" in the Client Info window and Fileset Report. # This will also prevent the contents of the Fileset from downloading and # installing. In this case, requirements scripts will be executed every 2 # minutes and the Fileset will be installed when they all return 0. # # For other types of scripts, any non-zero exit code (e.g. 1 or -1) will cause the # Fileset installation to fail and a script failure to be reported. # # If the script finishes without returning an exit code, the exit code 0 # (success) is assumed by default. # # Add the contents of your script below: # check if forticlient is installed. If yes, skip and exit to -220 so it doesn't try again FILPLACERING=/Applications/FortiClient.app if test -f "$FILPLACERING"; then # do nothing and exit -220 exit -220 else # forticlient is not installed so proceed exit 0 fi
Pierre-Nicolas Posted November 29, 2022 Posted November 29, 2022 Actually this should not be read as "-220" but as list bullet points. So exit 220 should do it. Just seeing that https://fwkb.atlassian.net/wiki/spaces/MAN/pages/4719213/5.11.+Fileset+Scripts could be updated to give more details about requirements scripts and specific exit codes.
Peter Thorn Posted December 1, 2022 Author Posted December 1, 2022 Thanks @Pierre-Nicolas for clearing that up. I will try it out. Cheers, Peter
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now