cups_toggle_macos.sh - limehawk/rmm-scripts GitHub Wiki
cups_toggle_macos.sh
Toggles the CUPS (Common Unix Printing System) web interface on or off.
Overview
This script toggles the CUPS (Common Unix Printing System) web interface on or off. If currently enabled, disables it. If disabled, enables it.
Purpose
Toggles the CUPS web interface on or off. If currently enabled, disables it. If disabled, enables it.
Prerequisites
- macOS or Linux with CUPS installed
- cupsctl command available
- Administrator/root privileges
Configuration
Required Inputs
No configuration required.
Behavior
- Checks for root privileges
- Checks current status of CUPS web interface
- If disabled, enables it and displays URL (http://localhost:631)
- If enabled, disables it
- Reports result
Security Notes
- No secrets exposed in output
- Runs with elevated privileges (sudo required)
- CUPS web interface provides access to printer configuration
Exit Codes
- 0 - Success
- 1 - Failure
Example Output
Enabling CUPS web interface:
[ CUPS WEB INTERFACE TOGGLE ]
--------------------------------------------------------------
Current Status : Disabled
Action : Enabling
Result : ENABLED
CUPS Web Interface URL: http://localhost:631
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
Disabling CUPS web interface:
[ CUPS WEB INTERFACE TOGGLE ]
--------------------------------------------------------------
Current Status : Enabled
Action : Disabling
Result : DISABLED
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
Version History
- 1.0.0 - Initial release
Links
- View Script Source
- Scripts - Back to script index