-
Notifications
You must be signed in to change notification settings - Fork 5
superops_agent_reinstall_macos.sh
Corey Watson edited this page Dec 1, 2025
·
1 revision
Performs a complete reinstallation of the SuperOps RMM agent on macOS.
Performs a complete reinstallation of the SuperOps RMM agent on macOS by uninstalling the current agent and installing a new version from a provided URL. This is useful for agent upgrades or fixing corrupted installations.
Performs a complete reinstallation of the SuperOps RMM agent on macOS by uninstalling the current agent and installing a new version from a provided URL. This is useful for agent upgrades or fixing corrupted installations.
- Bash shell
- macOS operating system
- Sudo privileges (for installation)
- Internet access to download new agent
- curl command (standard on macOS)
- SuperOps RMM agent currently installed
- PKGURL environment variable set by RMM platform
- PKGURL : (The download URL for the new SuperOps agent .pkg installer)
- UninstallScriptPath : "/Library/superops/uninstall.sh" (Path to current agent's uninstall script)
- Uses background process to handle reinstall after uninstall
- Waits for complete uninstallation before installing new version
- Downloads new agent to /tmp directory
- Monitors agent processes to ensure clean uninstall
- 5-second polling interval for uninstall completion
- Validates PKGURL environment variable is set
- Validates current agent uninstall script exists
- Starts background reinstall process
- Background process waits for uninstall to complete
- Executes current agent's uninstall script
- Background process downloads and installs new agent
- Reports progress and status to stdout
- Exits with code 0 on success, 1 on failure
- No secrets hardcoded
- New agent URL from environment variable
- Uses official SuperOps uninstall script
- Requires sudo elevation for installation
- Standard macOS installer security
- 0 success
- 1 failure
[ INPUT VALIDATION ]
--------------------------------------------------------------
Package URL: https://app.superops.com/downloads/agent.pkg
Uninstall Script: /Library/superops/uninstall.sh
[ OPERATION ]
--------------------------------------------------------------
Starting background reinstall process...
Background process will wait for uninstall completion
Uninstalling current SuperOps agent...
Executing uninstall script...
Uninstallation completed successfully.
[Background] Uninstall detected, waiting for cleanup...
[Background] Downloading new agent from URL...
[Background] File downloaded successfully.
[Background] Starting installation...
[Background] Installation completed successfully.
[ RESULT ]
--------------------------------------------------------------
Status: Success
[ FINAL STATUS ]
--------------------------------------------------------------
SuperOps agent reinstalled successfully
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
- 2025-11-02 v1.0.0 Initial migration from SuperOps
- Converted to Limehawk Style A format (bash)
- Added comprehensive error handling
- Added validation checks
- Added structured console output
- Made paths configurable
- Improved status reporting
- View Script Source
- Scripts - Back to script index