Skip to content

Commit

Permalink
commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaranionjc committed Sep 25, 2023
1 parent ce57700 commit 19cb50d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PowerShell/JumpCloud Commands Gallery/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@
"description": "This command will download and install the JumpCloud Password Manager to the device if it isn't already installed. On slower networks, timeouts with exit code 127 can occur. Manually setting the default timeout limit to 600 seconds may be advisable."
},
{
"name": "Mac - Install Sentinel One Agent | v1.0 JCCG",
"name": "Mac - Install Sentinel One Agent | v1.0.1 JCCG",
"type": "mac",
"command": "#!/bin/bash\n\nsentinelToken=\"YOURTOKEN\"\nDownloadURL=\"https://path/to/url.pkg\"\n\n############### Do Not Edit Below This Line ###############\n\nfilename=\"sentineloneagent.pkg\"\n\n# Check if already installed\nif [[ -d /Applications/SentinelOne/ ]]\n then\n echo \"Sentinel One Agent is Already Installed. Exiting...\"\n exit 0\nfi\n\n# Create Temp Folder\n#\nDATE=$(date '+%Y-%m-%d-%H-%M-%S')\nTempFolder=\"Download-$DATE\"\nmkdir /tmp/$TempFolder\n\n# Navigate to Temp Folder\n#\ncd /tmp/$TempFolder\n\n# Download Sentinel One file\ncurl -o $filename $DownloadURL\n\n\nDownloadFile=\"$(ls)\"\necho \"Downloaded $DownloadFile to /tmp/$TempFolder\"\n\n# Verifies PKG File\n#\nregex='\\.pkg$'\nif [[ $DownloadFile =~ $regex ]]; then\n PKGFile=\"$(echo \"$DownloadFile\")\"\n echo \"PKG File Found: $PKGFile\"\nelse\n echo \"File: $DownloadFile is not a PKG\"\n rm -r /tmp/$TempFolder\n echo \"Deleted /tmp/$TempFolder\"\n exit 1\nfi\n\n#Set Token\necho $sentinelToken > /tmp/$TempFolder/com.sentinelone.registration-token\n\n# Check signature and install\ncheck_pkg_sign=$(pkgutil --check-signature $PKGFile)\nif [[ $check_pkg_sign == *\"AYE5J54KN\"* ]] && [[ $check_pkg_sign == *\"Status: signed by a developer certificate issued by Apple\"* ]] && [[ $check_pkg_sign == *\"Notarization: trusted by the Apple notary service\"* ]]\nthen\n echo \"Package is signed. Installing...\"\n\n # Install Agent\n /usr/sbin/installer -pkg /tmp/$TempFolder/$PKGFile -target /Applications\nelse\n echo \"Package is unsigned. Exiting...\"\n exit 1\nfi\n\n# Remove Temp Folder and download\nrm -r /tmp/$TempFolder\necho \"Deleted /tmp/$TempFolder\"",
"command": "#!/bin/bash\n\nsentinelToken=\"YOURTOKEN\"\nDownloadURL=\"https://path/to/url.pkg\"\n\n############### Do Not Edit Below This Line ###############\nset -e\n\nfilename=\"sentineloneagent.pkg\"\n\n# Check if already installed\nif [[ -d /Applications/SentinelOne/ ]]\n then\n echo \"Sentinel One Agent is Already Installed. Exiting...\"\n exit 0\nfi\n\n# Create Temp Folder\n#\nDATE=$(date '+%Y-%m-%d-%H-%M-%S')\nTempFolder=\"Download-$DATE\"\nmkdir /tmp/$TempFolder\n\n# Navigate to Temp Folder\n#\ncd /tmp/$TempFolder\n\n# Download Sentinel One file\ncurl --fail -o \"$filename\" \"$DownloadURL\"\n\nDownloadFile=\"$(ls)\"\necho \"Downloaded $DownloadFile to /tmp/$TempFolder\"\n\n# Verifies PKG File\n#\nregex='\\.pkg$'\nif [[ $DownloadFile =~ $regex ]]; then\n PKGFile=\"$(echo \"$DownloadFile\")\"\n echo \"PKG File Found: $PKGFile\"\nelse\n echo \"File: $DownloadFile is not a PKG\"\n rm -r /tmp/$TempFolder\n echo \"Deleted /tmp/$TempFolder\"\n exit 1\nfi\n\n#Set Token\necho $sentinelToken > /tmp/$TempFolder/com.sentinelone.registration-token\n\n# Check signature and install\ncheck_pkg_sign=$(pkgutil --check-signature $PKGFile)\nif [[ $check_pkg_sign == *\"AYE5J54KN\"* ]] && [[ $check_pkg_sign == *\"Status: signed by a developer certificate issued by Apple\"* ]] && [[ $check_pkg_sign == *\"Notarization: trusted by the Apple notary service\"* ]]\nthen\n echo \"Package is signed. Installing...\"\n\n # Install Agent\n /usr/sbin/installer -pkg /tmp/$TempFolder/$PKGFile -target /Applications\nelse\n echo \"Package is unsigned. Exiting...\"\n exit 1\nfi\n\n# Remove Temp Folder and download\nrm -r /tmp/$TempFolder\necho \"Deleted /tmp/$TempFolder\"",
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Mac%20Commands/Mac%20-%20Install%20Sentinel%20One%20Agent.md",
"description": "This command will download and install the Sentinel One Agent to the device if it isn't already installed.\n\nSpecifically for this command:\n\n1. Download the Sentinel One Agent installer and host it at a URL that your devices can access. Set this URL to the \"DownloadURL\" of this script.\n2. Extend the command timeout to a value that makes sense in your environment. The suggested command timeout for an environment with average network speeds on devices with average computing power is 10 minutes. Note that the command may timeout with a 124 error code in the command result window if not extended, but the script will continue to run."
},
Expand Down

0 comments on commit 19cb50d

Please sign in to comment.