[ { "choices": [ ], "data_type": "string", "default_value": null, "description": "macOS 14 Sonoma compatibilty", "display_name": "macOS 14 Compatible Devices", "field_name": "macos_14_compatible_devices", "is_global": true, "metadata": { "macos": { "environment": { "imac": "19,21", "imacpro": "1,1", "mac": "13,15", "macbook": "10,10", "macbookair": "8,10", "macbookpro": "15,18", "macmini": "8,9", "macpro": "7,7" }, "extension": "sh", "must_exit_zero": true, "replace_line_feed": true, "source": "#!/bin/zsh\n#\n# FileWave client will execute this script. The output will be used as the value of the custom field.\n#\n# Below is an example of how to read the value of one ENVIRONMENT VARIABLE in your script:\n\n# my_var=${ENV_VAR_NAME}\n#\n\n# BEGIN\n\ncompatibility=\"\"\n\nos_vers=$(sw_vers -productVersion)\n\nif [ ${os_vers%%.*} -eq 14 ]\nthen\n\tcompatibility=\"compatible\"\nfi\n\nhw_model=$(sysctl -n hw.model | tr '[:upper:]' '[:lower:]')\nhw_model_num=$(echo ${hw_model%%,*} | tr -dc '0-9')\n\nfunction compare_model_num {\n\n\tlowest_mod=${1%%,*}\n\thighest_mod=${1##*,}\n\n\tif [ $hw_model_num -lt $lowest_mod ]\n\tthen\n\t\tcompatibility=incompatible\n\telif [ $hw_model_num -le $highest_mod ]\n\tthen\n\t\tcompatibility=compatible\n\telse\n\t\tcompatibility=$hw_model\n\tfi\n}\n\nif [ -z \"$compatibility\" ]\nthen\n\tcase ${hw_model%%,*} in\n\n\t\t\"macbook\"[0-9]*)\n\t\t\tcompare_model_num $macbook\n\t\t\t;;\n\t\t\"macbookpro\"[0-9]*)\n\t\t\tcompare_model_num $macbookpro\n\t\t\t;;\n\t\t\"macbookair\"[0-9]*)\n\t\t\tcompare_model_num $macbookair\n\t\t\t;;\n\t\t\"macmini\"[0-9]*)\n\t\t\tcompare_model_num $macmini\n\t\t\t;;\n\t\t\"macpro\"[0-9]*)\n\t\t\tcompare_model_num $macpro\n\t\t\t;;\n\t\t\"imac\"[0-9]*)\n\t\t\tcompare_model_num $imac\n\t\t\t;;\n\t\t\"imacpro\"[0-9])\n\t\t\tcompare_model_num $imacpro\n\t\t\t;;\n\t\t\"mac\"[0-9]*)\n\t\t\tcompare_model_num $mac\n\t\t\t;;\n\tesac\nfi\n\necho \"$compatibility\"\n\nexit 0\n\n" }, "windows": { "extension": "ps1", "must_exit_zero": true, "replace_line_feed": true, "source": "# FileWave client will execute this script. The output will be used as the value of the custom field.\n# \n# Below is an example of how to read the value of one ENVIRONMENT VARIABLE in your script:\n\n# $my_var = $Env:ENV_VAR_NAME\n# \n\n#######\n# BEGIN\n\n# Replace me\necho_me \"NA\"\n\n#####\n# END\n" } }, "provider": 1, "to_be_deleted": false, "used_in_workflows": false } ]