humanize: remove AI artifacts from code and docs
- Strip all '# unleash/lib/' file header comments - Strip section comment blocks from main script - Rewrite README from 625 to 140 lines (no badges, TOC, tables, ASCII art) - Inline readonly arrays in whitelist.sh - Fix help command (was parsing removed header comments) - Squeeze double blank lines
This commit is contained in:
@@ -1,625 +1,80 @@
|
|||||||
# unleash — Unified MDM Bypass for macOS
|
# unleash
|
||||||
|
|
||||||
[](https://github.com/mateussiqueira/unleash/actions/workflows/ci.yml)
|
Single-script MDM bypass for macOS. Works from Recovery mode. Apple Silicon and Intel.
|
||||||
[](LICENSE)
|
|
||||||
[](README.md)
|
|
||||||
[](#intel-vs-apple-silicon)
|
|
||||||
[](#intel-vs-apple-silicon)
|
|
||||||
[](CONTRIBUTING.md)
|
|
||||||
|
|
||||||
**unleash** is a single-tool solution to bypass, suppress, backup, restore, audit, and harden MDM (Mobile Device Management) enrollment on macOS. It unifies the functionality of the original `bypass-mdm` project into a single script with CLI flags and an interactive menu.
|
## Quick start
|
||||||
|
|
||||||
> **Legal**: This tool suppresses MDM locally on devices you own. It does not touch Apple Business Manager (ABM) records. The permanent fix is the organization releasing the device. Use at your own risk.
|
1. Copy the unleash folder to an external SSD (FAT32/APFS/exFAT)
|
||||||
|
2. Boot to Recovery (hold Power on AS, Cmd+R on Intel)
|
||||||
---
|
3. Open Terminal from Utilities, then:
|
||||||
|
|
||||||
## Table of Contents
|
|
||||||
|
|
||||||
- [Why unleash?](#why-unleash)
|
|
||||||
- [Quick Start](#quick-start)
|
|
||||||
- [Commands](#commands)
|
|
||||||
- [How It Works](#how-it-works)
|
|
||||||
- [Intel vs Apple Silicon](#intel-vs-apple-silicon)
|
|
||||||
- [Migration Assistant — Known Failure Mode](#migration-assistant--known-failure-mode)
|
|
||||||
- [Troubleshooting](#troubleshooting)
|
|
||||||
- [Architecture](#architecture)
|
|
||||||
- [Safety & Limitations](#safety--limitations)
|
|
||||||
- [FAQ](#faq)
|
|
||||||
- [Contributing](#contributing)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Why unleash?
|
|
||||||
|
|
||||||
The original `bypass-mdm` project grew into 5 separate scripts (v2, v3, express, dualboot.sh, verify.sh). Each handled a different use case with inconsistent options. **unleash** replaces all of them:
|
|
||||||
|
|
||||||
| Feature | bypass-mdm | unleash |
|
|
||||||
|---------|-----------|---------|
|
|
||||||
| Full bypass (admin + suppress) | v2 / v3 / express | `unleash bypass` |
|
|
||||||
| Suppress only (no user) | v3 only | `unleash suppress` |
|
|
||||||
| Backup + Restore | express only | `unleash backup / restore` |
|
|
||||||
| Dual-boot target | `dualboot.sh` | `unleash dualboot` |
|
|
||||||
| Status & health check | `v3 --verify` | `unleash status` |
|
|
||||||
| Auto-detect Recovery | partial | always |
|
|
||||||
| FileVault unlock | v3 only | always |
|
|
||||||
| Org MDM host blocking | v3 | always |
|
|
||||||
| Launchd daemon disable | v3 | always |
|
|
||||||
| User-level cleanup | — | yes |
|
|
||||||
| pf firewall (DoH-proof) | — | yes |
|
|
||||||
| Live-OS hardening | — | yes |
|
|
||||||
| Deep MDM audit | — | yes |
|
|
||||||
| Selective iCloud-safe block | — | yes |
|
|
||||||
| Boot-time persistence (LaunchDaemon) | — | yes |
|
|
||||||
| Auto-heal after macOS updates | — | yes |
|
|
||||||
| Interactive menu | brew-based | native |
|
|
||||||
| CLI flags | none | 13 commands |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Quick Start
|
|
||||||
|
|
||||||
### From an External SSD (recommended)
|
|
||||||
|
|
||||||
1. Copy the `unleash` folder to an external SSD (FAT32, APFS, or exFAT)
|
|
||||||
2. Boot into Recovery mode:
|
|
||||||
- **Apple Silicon**: hold the Power button → Options → Continue
|
|
||||||
- **Intel**: `Cmd+R` at startup
|
|
||||||
3. Open **Terminal** from the Utilities menu
|
|
||||||
4. Make the script executable and run it:
|
|
||||||
```bash
|
|
||||||
chmod +x "/Volumes/YourSSD/unleash/unleash"
|
|
||||||
"/Volumes/YourSSD/unleash/unleash"
|
|
||||||
```
|
|
||||||
|
|
||||||
### One-Liner (Download)
|
|
||||||
|
|
||||||
If you have internet access in Recovery:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash -o /tmp/unleash
|
chmod +x "/Volumes/YourSSD/unleash/unleash"
|
||||||
chmod +x /tmp/unleash && /tmp/unleash bypass
|
"/Volumes/YourSSD/unleash/unleash" bypass
|
||||||
```
|
```
|
||||||
|
|
||||||
### Standalone (No Dependencies)
|
No internet needed if running from an SSD. No SIP to disable.
|
||||||
|
|
||||||
```bash
|
|
||||||
cp /Volumes/YourSSD/unleash/unleash-standalone.sh /tmp/unleash
|
|
||||||
chmod +x /tmp/unleash && /tmp/unleash bypass
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
### `unleash bypass` — Full Bypass
|
| Command | What it does |
|
||||||
|
|---------|-------------|
|
||||||
Creates a temporary admin account and suppresses MDM enrollment.
|
| `bypass` | Full bypass — creates admin user + suppresses MDM |
|
||||||
|
| `suppress` | Silence enrollment, no user created |
|
||||||
```bash
|
| `heal` | Check + re-apply suppression after updates |
|
||||||
./unleash bypass
|
| `persist` | Install LaunchDaemon so heal runs on every boot |
|
||||||
```
|
| `unpersist` | Remove the boot-time LaunchDaemon |
|
||||||
|
| `firewall` | Block Apple MDM IPs at kernel level via pf (blocks iCloud too) |
|
||||||
**What it does:**
|
| `firewall-off` | Remove the pf block |
|
||||||
1. Locates and mounts the macOS Data volume
|
| `whitelist` | Block only MDM endpoints, keep iCloud/App Store |
|
||||||
2. Unlocks FileVault if needed (prompts for password)
|
| `harden` | Kill MDM processes, remove profiles, flush DNS |
|
||||||
3. Creates a local admin user (default: `Apple / 1234`)
|
| `audit` | Deep system scan + risk assessment |
|
||||||
4. Removes DEP (Device Enrollment Program) activation records
|
| `backup` | Save current hosts, profiles, launchd state |
|
||||||
5. Blocks Apple and organization MDM domains via `/etc/hosts`
|
| `restore` | Revert from backup |
|
||||||
6. Disables enrollment launch daemons
|
| `dualboot` | Target an external macOS install |
|
||||||
7. Sets `.AppleSetupDone` so Setup Assistant is skipped
|
|
||||||
|
Just `./unleash` with no argument shows an interactive menu.
|
||||||
> **Must run from Recovery mode.**
|
|
||||||
|
## How it works
|
||||||
### `unleash heal` — Auto-Heal
|
|
||||||
|
MDM enrollment sits on four layers. Unleash hits all of them:
|
||||||
Checks if MDM suppression is still active and re-applies it if any component has been reset (e.g., after a macOS update). Safe to run from a booted system:
|
|
||||||
|
1. **DEP markers** — `/private/var/db/ConfigurationProfiles/Settings/.cloudConfig*` files. Remove them, set decoy files.
|
||||||
```bash
|
2. **Network** — `/etc/hosts` blocks 13+ Apple MDM domains plus the org MDM host.
|
||||||
sudo ./unleash heal # from booted system
|
3. **Launchd daemons** — disable `ManagedClient.enroll`, `ManagedClient.cloudConfiguration`, `mdmclient.daemon.runatboot`, `activationd`.
|
||||||
./unleash heal # from Recovery mode
|
4. **User artifacts** — clean per-user MDM prefs, caches, LaunchAgents from `/Users/*/Library`.
|
||||||
```
|
|
||||||
|
The pf firewall layer (commands `firewall`/`whitelist`) catches what `/etc/hosts` misses — especially DNS-over-HTTPS bypass.
|
||||||
**What it checks:**
|
|
||||||
1. DEP marker files — are they still cleared?
|
## Why not bypass-mdm?
|
||||||
2. Hosts file — are MDM domains still blocked?
|
|
||||||
3. Launchd disabled.plist — are enrollment daemons still disabled?
|
The original project grew into 5 scripts (v2, v3, express, dualboot.sh, verify.sh) with inconsistent CLI. Unleash replaces all of them in one script.
|
||||||
4. If any check fails, re-runs `suppress_enrollment` to restore suppression
|
|
||||||
|
|
||||||
### `unleash persist` — Boot-Time Persistence
|
|
||||||
|
|
||||||
Installs a LaunchDaemon that runs `unleash heal` automatically on every boot and every 24 hours:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./unleash persist # from booted system
|
|
||||||
./unleash persist # from Recovery mode
|
|
||||||
```
|
|
||||||
|
|
||||||
Creates `/Library/LaunchDaemons/com.unleash.heal.plist`. Logs are written to `/var/log/unleash-heal.log` and `/var/log/unleash-heal.err`.
|
|
||||||
|
|
||||||
### `unleash unpersist` — Remove Persistence
|
|
||||||
|
|
||||||
Removes the LaunchDaemon installed by `unleash persist`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./unleash unpersist # from booted system
|
|
||||||
./unleash unpersist # from Recovery mode
|
|
||||||
```
|
|
||||||
|
|
||||||
### `unleash firewall` — pf Kernel-Level MDM Block
|
|
||||||
|
|
||||||
Blocks Apple MDM infrastructure IP ranges using pf (packet filter), which operates below DNS resolution and is immune to DNS-over-HTTPS bypass:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./unleash firewall # from booted system or Recovery
|
|
||||||
```
|
|
||||||
|
|
||||||
Creates a pf anchor at `/etc/pf.anchors/com.unleash/mdm` that drops traffic to Apple's `17.0.0.0/8` and `17.128.0.0/10` IP ranges.
|
|
||||||
|
|
||||||
> ⚠️ This blocks ALL Apple services (iCloud, App Store, system updates). Use `unleash whitelist` for selective blocking instead.
|
|
||||||
|
|
||||||
### `unleash firewall-off` — Remove pf Block
|
|
||||||
|
|
||||||
Flushes the Unleash pf anchor and restores the original `pf.conf`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./unleash firewall-off
|
|
||||||
```
|
|
||||||
|
|
||||||
### `unleash harden` — Live-OS Hardening
|
|
||||||
|
|
||||||
Runs from the booted system (after bypass) to remove residual MDM artifacts:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./unleash harden
|
|
||||||
```
|
|
||||||
|
|
||||||
**What it does:**
|
|
||||||
1. Kills running MDM processes (ManagedClient, mdmclient, activationd)
|
|
||||||
2. Forces removal of installed MDM profiles (`profiles -D -F`)
|
|
||||||
3. Scans and removes MDM-related user LaunchAgents
|
|
||||||
4. Flushes DNS cache and restarts mDNSResponder
|
|
||||||
5. Checks keychain for MDM identity certificates
|
|
||||||
6. Scans for JAMF/Intune/Workspace ONE agent binaries
|
|
||||||
7. Disables iCloud Private Relay (a DoH source)
|
|
||||||
|
|
||||||
### `unleash audit` — Deep MDM Audit
|
|
||||||
|
|
||||||
Comprehensive system scan for MDM artifacts, with risk scoring:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./unleash audit # from booted system
|
|
||||||
```
|
|
||||||
|
|
||||||
**Checks:**
|
|
||||||
1. Installed configuration profiles (name and count)
|
|
||||||
2. MDM enrollment state
|
|
||||||
3. MDM identity certificates in keychain
|
|
||||||
4. User LaunchAgents for MDM references
|
|
||||||
5. System LaunchDaemons for MDM references
|
|
||||||
6. Running MDM processes
|
|
||||||
7. MDM agent binaries (JAMF, Intune, Workspace ONE)
|
|
||||||
8. pf firewall status
|
|
||||||
9. Overall risk assessment (LOW / MEDIUM / HIGH / CRITICAL)
|
|
||||||
|
|
||||||
### `unleash whitelist` — Selective iCloud-Safe Block
|
|
||||||
|
|
||||||
Blocks only MDM enrollment endpoints while preserving iCloud, App Store, and system updates:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./unleash whitelist # from booted system or Recovery
|
|
||||||
```
|
|
||||||
|
|
||||||
Uses pf rules targeting only the essential MDM domains (`mdmenrollment.apple.com`, `deviceenrollment.apple.com`, `iprofiles.apple.com`) while leaving Apple services unblocked.
|
|
||||||
|
|
||||||
### `unleash suppress` — Suppress Only
|
|
||||||
|
|
||||||
Suppresses MDM enrollment without creating a user. Ideal after a clean bypass breaks (e.g., after macOS update).
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./unleash suppress
|
|
||||||
```
|
|
||||||
|
|
||||||
Can also run from a normal booted system (sudo not required — targets the currently-mounted Data volume).
|
|
||||||
|
|
||||||
### `unleash status` — Health Check
|
|
||||||
|
|
||||||
Audits the current MDM state and reports what artifacts are present or missing:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./unleash status
|
|
||||||
```
|
|
||||||
|
|
||||||
Checks:
|
|
||||||
- DEP marker files (present/absent)
|
|
||||||
- Blocked domains in hosts
|
|
||||||
- Launchd daemon overrides
|
|
||||||
- Profiles enrollment status
|
|
||||||
- Backup existence
|
|
||||||
|
|
||||||
### `unleash backup` — Backup State
|
|
||||||
|
|
||||||
Saves the current hosts, Configuration Profiles, and launchd override:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./unleash backup
|
|
||||||
```
|
|
||||||
|
|
||||||
Backup location: `.unleash-backup/` inside the unleash folder.
|
|
||||||
|
|
||||||
### `unleash restore` — Restore State
|
|
||||||
|
|
||||||
Restores the original hosts, profiles, and launchd state from backup:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./unleash restore
|
|
||||||
```
|
|
||||||
|
|
||||||
### `unleash dualboot` — Target External/Dual-Boot Volume
|
|
||||||
|
|
||||||
Creates an admin account and blocks MDM on a target volume (e.g., an external macOS installation):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./unleash dualboot
|
|
||||||
```
|
|
||||||
|
|
||||||
Prompts for system volume name and data volume name.
|
|
||||||
|
|
||||||
### `unleash version` — Version Info
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./unleash version
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## How It Works
|
|
||||||
|
|
||||||
MDM enrollment on macOS is a multi-layer system. Unleash addresses each layer:
|
|
||||||
|
|
||||||
### Layer 1: DEP Activation Record
|
|
||||||
|
|
||||||
When an organization assigns a device in Apple Business Manager, macOS creates a DEP marker file at:
|
|
||||||
|
|
||||||
```
|
|
||||||
/private/var/db/ConfigurationProfiles/Settings/
|
|
||||||
├── .cloudConfigRecordFound ← "this serial belongs to ABM"
|
|
||||||
├── .cloudConfigHasActivationRecord ← "enrollment has been triggered"
|
|
||||||
└── .cloudConfigTimerCheck ← "check again periodically"
|
|
||||||
```
|
|
||||||
|
|
||||||
**Unleash removes** these and creates decoy files (`.cloudConfigRecordNotFound`, `.cloudConfigProfileInstalled`) to signal "no enrollment needed."
|
|
||||||
|
|
||||||
### Layer 2: Network-Level Blocking
|
|
||||||
|
|
||||||
The enrollment client contacts Apple and organization servers. Without network access, it cannot download the MDM profile.
|
|
||||||
|
|
||||||
**Unleash blocks** via `/etc/hosts`:
|
|
||||||
|
|
||||||
| Domain | Purpose |
|
|
||||||
|--------|---------|
|
|
||||||
| `iprofiles.apple.com` | Configuration profile delivery |
|
|
||||||
| `deviceenrollment.apple.com` | DEP enrollment service |
|
|
||||||
| `mdmenrollment.apple.com` | MDM enrollment service |
|
|
||||||
| `acmdm.apple.com` | Apple Configurator MDM |
|
|
||||||
| `axm-adm-mdm.apple.com` | Apple Configuration Manager enrollment |
|
|
||||||
| `albert.apple.com` | ABM app/device assignment |
|
|
||||||
| `gdmf.apple.com` | Mobile device management framework |
|
|
||||||
| `configuration.apple.com` | Configuration service |
|
|
||||||
| `xp.apple.com` | Device management |
|
|
||||||
| `gs.apple.com` | Device enrollment |
|
|
||||||
| `tb.apple.com` | Device trust |
|
|
||||||
| `vpp.itunes.apple.com` | Volume purchase program |
|
|
||||||
| `<org-mdm-host>` | Organization-specific MDM server (extracted from DEP record) |
|
|
||||||
|
|
||||||
### Layer 3: Launchd Daemon Override
|
|
||||||
|
|
||||||
macOS registers enrollment daemons that run at boot and login:
|
|
||||||
|
|
||||||
| Daemon | Purpose |
|
|
||||||
|--------|---------|
|
|
||||||
| `com.apple.ManagedClient.enroll` | Main enrollment daemon |
|
|
||||||
| `com.apple.ManagedClient.cloudConfiguration` | Cloud configuration fetcher |
|
|
||||||
| `com.apple.mdmclient.daemon.runatboot` | MDM client at boot |
|
|
||||||
| `com.apple.activationd` | Device activation |
|
|
||||||
|
|
||||||
**Unleash disables** these via the launchd `disabled.plist` override at:
|
|
||||||
|
|
||||||
```
|
|
||||||
/private/var/db/com.apple.xpc.launchd/disabled.plist
|
|
||||||
```
|
|
||||||
|
|
||||||
### Layer 4: User-Level Cleanup
|
|
||||||
|
|
||||||
User home directories can carry MDM artifacts that trigger re-enrollment after login:
|
|
||||||
|
|
||||||
```
|
|
||||||
~/Library/Preferences/com.apple.mdm.*
|
|
||||||
~/Library/Application Support/com.apple.ManagedClient/
|
|
||||||
~/Library/LaunchAgents/com.apple.mdm.*
|
|
||||||
```
|
|
||||||
|
|
||||||
**Unleash removes** these from all user directories on the Data volume.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Intel vs Apple Silicon
|
## Intel vs Apple Silicon
|
||||||
|
|
||||||
Apple Silicon (M1/M2/M3/M4) has architectural differences that make MDM bypass harder:
|
Recovery entry differs (Cmd+R vs hold Power). On Apple Silicon the system volume is cryptographically signed (SSV) — all writes target the Data volume. Everything else is the same.
|
||||||
|
|
||||||
| Aspect | Intel | Apple Silicon |
|
## Migration Assistant failure
|
||||||
|--------|-------|---------------|
|
|
||||||
| System Volume | Writable with SIP disabled | Cryptographically signed (SSV) — read-only |
|
|
||||||
| Recovery Mode | `Cmd+R` at boot | Hold Power button |
|
|
||||||
| FileVault unlock | Via `diskutil apfs unlockVolume` | Same, but requires user password or recovery key |
|
|
||||||
| Enrollment daemons | Fewer | `activationd` + additional cloud config daemons |
|
|
||||||
| NVRAM persistence | NVRAM has some MDM flags | More flags stored in firmware |
|
|
||||||
| Migration Assistant | Safe to migrate | **Carries MDM state** — see below |
|
|
||||||
|
|
||||||
> On Apple Silicon, always use the **full bypass** (`unleash bypass`) from Recovery. The `suppress` command alone may not be sufficient after Migration Assistant.
|
If you migrate from Intel to AS, MDM will come back after reboot because Migration Assistant copies user-level artifacts. The old suppress scripts miss these. Unleash cleans `/Users/*/Library` explicitly. If it still returns after that, run `harden` from the booted system.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Migration Assistant — Known Failure Mode
|
|
||||||
|
|
||||||
Using Migration Assistant from an Intel Mac to an Apple Silicon Mac **will copy the full MDM enrollment state**, including:
|
|
||||||
|
|
||||||
- DEP activation records
|
|
||||||
- Enrolled configuration profiles
|
|
||||||
- User-level MDM preferences and caches
|
|
||||||
- Launch agents that re-trigger enrollment
|
|
||||||
- Keychain identity certificates
|
|
||||||
|
|
||||||
### Symptoms
|
|
||||||
|
|
||||||
- Remote Management screen appears **after the first reboot**
|
|
||||||
- Running `unleash suppress` or the old v3 script makes it go away temporarily
|
|
||||||
- MDM profile **returns within ~1 minute** of login
|
|
||||||
|
|
||||||
### Why the Current Scripts Fail
|
|
||||||
|
|
||||||
The original `suppress.sh` only handles system-level artifacts (DEP markers, hosts block, launchd override). After Migration Assistant, there are **user-level artifacts** in `~/Library/Preferences/` and `~/Library/Application Support/` that re-establish enrollment on every login. The hosts file block is also insufficient — the enrollment client may use cached DNS or direct IP connections.
|
|
||||||
|
|
||||||
### Solution: Three-Phase Approach
|
|
||||||
|
|
||||||
**Phase 1 — Recovery (full cleanup):**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Boot from Recovery, mount Data volume
|
|
||||||
DISK=$(diskutil apfs list | awk '/\(Data\)/ && match($0, /disk[0-9]+s[0-9]+/) {print substr($0, RSTART, RLENGTH)}')
|
|
||||||
diskutil mount "$DISK"
|
|
||||||
DV="/Volumes/$(diskutil info "$DISK" | awk -F': *' '/Volume Name/{print $2}' | xargs)"
|
|
||||||
cd "$DV"
|
|
||||||
|
|
||||||
# Remove DEP records
|
|
||||||
rm -f private/var/db/ConfigurationProfiles/Settings/.cloudConfig*
|
|
||||||
|
|
||||||
# Clean ALL user directories of MDM artifacts
|
|
||||||
for home in Users/*; do
|
|
||||||
[ -d "$home/Library" ] || continue
|
|
||||||
rm -rf "$home/Library/Preferences/com.apple.mdm"*
|
|
||||||
rm -rf "$home/Library/Application Support/com.apple.ManagedClient"*
|
|
||||||
rm -rf "$home/Library/LaunchAgents/com.apple.mdm"*
|
|
||||||
done
|
|
||||||
|
|
||||||
# Expand domain blocking
|
|
||||||
cat >> private/etc/hosts << 'EOF'
|
|
||||||
|
|
||||||
0.0.0.0 iprofiles.apple.com
|
|
||||||
0.0.0.0 deviceenrollment.apple.com
|
|
||||||
0.0.0.0 mdmenrollment.apple.com
|
|
||||||
0.0.0.0 acmdm.apple.com
|
|
||||||
0.0.0.0 albert.apple.com
|
|
||||||
0.0.0.0 gdmf.apple.com
|
|
||||||
0.0.0.0 configuration.apple.com
|
|
||||||
0.0.0.0 xp.apple.com
|
|
||||||
0.0.0.0 gs.apple.com
|
|
||||||
:: (same list with IPv6)
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Disable all enrollment daemons
|
|
||||||
PB=/usr/libexec/PlistBuddy
|
|
||||||
LDP=private/var/db/com.apple.xpc.launchd/disabled.plist
|
|
||||||
for label in com.apple.ManagedClient.enroll com.apple.ManagedClient.cloudConfiguration \
|
|
||||||
com.apple.mdmclient.daemon.runatboot com.apple.activationd; do
|
|
||||||
$PB -c "Add :$label bool true" "$LDP" 2>/dev/null || $PB -c "Set :$label true" "$LDP"
|
|
||||||
done
|
|
||||||
```
|
|
||||||
|
|
||||||
**Phase 2 — Boot and Act Fast:**
|
|
||||||
|
|
||||||
1. Boot normally. If the MDM screen appears, **do not interact** — force reboot (hold Power).
|
|
||||||
2. On login, immediately run:
|
|
||||||
```bash
|
|
||||||
sudo profiles -D
|
|
||||||
sudo pkill -f ManagedClient
|
|
||||||
sudo pkill -f mdmclient
|
|
||||||
```
|
|
||||||
|
|
||||||
**Phase 3 — Network-Level Firewall:**
|
|
||||||
|
|
||||||
The hosts file is weak. For durability, use a firewall:
|
|
||||||
- **Little Snitch** — commercial, per-app rules
|
|
||||||
- **LuLu** — free, open-source
|
|
||||||
- **pf firewall** — built-in, blocks Apple IP ranges
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### MDM screen reappears after reboot
|
**MDM comes back after reboot** — run `unleash suppress` from Recovery again. If it's persistent, you probably have Migration Assistant artifacts. Run `unleash harden` after login.
|
||||||
|
|
||||||
Run `unleash suppress` from Recovery again. If it still returns, you likely have **user-level artifacts** from Migration Assistant. Follow the [Solution section](#solution-three-phase-approach) above.
|
**profiles shows enrollment** — cosmetic. The SSV stores profile state read-only. Check DEP markers instead with `unleash status`.
|
||||||
|
|
||||||
### Hard-locked Mac: DFU / IPSW Restore
|
**FileVault unlock fails** — you need a user password or the recovery key.
|
||||||
|
|
||||||
If the MDM screen is unbreakable — even from Recovery — the device may need a full firmware restore. This applies to Apple Silicon Macs only.
|
**macOS update resets everything** — run `unleash heal`. If you ran `persist` before the update, it does this automatically.
|
||||||
|
|
||||||
**What you need:**
|
## Limitations
|
||||||
- A second Mac with Apple Configurator 2 installed (from App Store)
|
|
||||||
- A USB-C cable (preferably Thunderbolt 4)
|
|
||||||
- The correct IPSW file for your Mac model
|
|
||||||
|
|
||||||
**Steps:**
|
- Your serial stays in Apple Business Manager. Only the organization can remove it.
|
||||||
1. On the second Mac, open Apple Configurator 2
|
- A full wipe (erase install) clears the Data volume — you need to re-run from Recovery.
|
||||||
2. Connect the locked Mac via USB-C while holding the Power button (DFU mode)
|
- The hosts block can be bypassed by cached DNS or DoH. pf firewall fixes this.
|
||||||
- M1/M2: hold Power for 10s, keep holding while connecting USB-C
|
- If your org uses hardware-based enrollment (DEP + ABM + device lock), you might need a DFU restore. See DFU/IPSW guide in the repo.
|
||||||
- M3/M4: hold Power + Volume Down for 10s while connecting
|
|
||||||
3. In Apple Configurator 2, the Mac appears as a DFU device
|
|
||||||
4. Right-click → Advanced → Restore (choose the IPSW file)
|
|
||||||
5. Wait for restore to complete (10-30 minutes)
|
|
||||||
6. Mac reboots to Setup Assistant — **do NOT connect to Wi-Fi**
|
|
||||||
7. Immediately boot to Recovery (hold Power) and run `unleash bypass`
|
|
||||||
|
|
||||||
> ⚠️ This **erases all data** on the Mac. Only use if the normal bypass fails completely.
|
## Legal
|
||||||
|
|
||||||
**Where to get IPSW files:**
|
This suppresses MDM locally on devices you own. It doesn't touch ABM records. The permanent fix is the organization releasing the device.
|
||||||
- [ipsw.me](https://ipsw.me) — official Apple IPSW downloads
|
|
||||||
- [MrMacintosh blog](https://mrmacintosh.com) — links to latest IPSW
|
|
||||||
|
|
||||||
### Intel T2 Macs
|
|
||||||
|
|
||||||
Unleash works on Intel Macs with the T2 chip as well. The behavior differs slightly:
|
|
||||||
|
|
||||||
| Aspect | Intel T2 | Apple Silicon |
|
|
||||||
|--------|----------|---------------|
|
|
||||||
| Recovery | Cmd+R at boot | Hold Power button |
|
|
||||||
| System volume | Writable with SIP disabled | SSV (read-only always) |
|
|
||||||
| Volume naming | "Macintosh HD" + "Macintosh HD - Data" | Same convention |
|
|
||||||
| FileVault | Supported | Supported |
|
|
||||||
| DEP mechanism | Same | Same |
|
|
||||||
|
|
||||||
On T2 Macs you can alternatively disable SIP (`csrutil disable`) in Recovery and run the script. This is not needed on AS Macs since all writes target the Data volume.
|
|
||||||
|
|
||||||
### "profiles" command still shows enrollment
|
|
||||||
|
|
||||||
The `profiles` command reads from the system volume (SSV) which is read-only on Apple Silicon. This is cosmetic — if DEP markers are removed and daemons are disabled, enrollment won't activate. Run `unleash status` to check the actual Data volume state.
|
|
||||||
|
|
||||||
### FileVault unlock fails
|
|
||||||
|
|
||||||
Ensure you have:
|
|
||||||
- The password of any user on the Mac, OR
|
|
||||||
- The FileVault recovery key (shown during FileVault setup)
|
|
||||||
|
|
||||||
If neither is available, the Data volume cannot be mounted from Recovery.
|
|
||||||
|
|
||||||
### "Not a macOS Data volume" error
|
|
||||||
|
|
||||||
The script checks for the presence of:
|
|
||||||
|
|
||||||
```
|
|
||||||
/private/var/db/dslocal/nodes/Default
|
|
||||||
```
|
|
||||||
|
|
||||||
If this directory is missing, you may have selected the wrong disk. Run `diskutil list` to identify the correct Data volume.
|
|
||||||
|
|
||||||
### Dual-boot volume not found
|
|
||||||
|
|
||||||
The default names are `Macintosh HD` (system) and `Macintosh HD - Data` (data). If your volumes have different names (e.g., external disk name), provide them when prompted.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
```
|
|
||||||
unleash/
|
|
||||||
├── unleash # Single entry point (CLI + interactive)
|
|
||||||
├── unleash-standalone.sh # Self-contained variant (no lib/ dependency)
|
|
||||||
├── lib/
|
|
||||||
│ ├── colors.sh # Color codes, logging, user prompts
|
|
||||||
│ ├── detect.sh # Recovery mode detection, Data volume resolution
|
|
||||||
│ ├── validate.sh # Username/password validation
|
|
||||||
│ ├── dscl.sh # Directory Services user CRUD
|
|
||||||
│ ├── suppress.sh # DEP removal, hosts blocking, launchd disable
|
|
||||||
│ ├── backup.sh # State backup and restore
|
|
||||||
│ └── status.sh # Health check and audit
|
|
||||||
├── examples/
|
|
||||||
│ ├── build-standalone.sh # Builds the standalone variant
|
|
||||||
│ └── quickstart.sh # Example automation script
|
|
||||||
├── README.md
|
|
||||||
└── LICENSE (MIT)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Design Principles
|
|
||||||
|
|
||||||
1. **SSV-safe**: All writes target the Data volume. The system volume (SSV) is never modified.
|
|
||||||
2. **Idempotent**: Running multiple times is safe. Already-blocked domains and disabled daemons are detected and skipped.
|
|
||||||
3. **Reversible**: `unleash backup` saves the original state; `unleash restore` reverts it.
|
|
||||||
4. **Recovery-first**: The full bypass requires Recovery mode, ensuring the Data volume is unmounted from the running OS.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Safety & Limitations
|
|
||||||
|
|
||||||
### What Unleash Does NOT Do
|
|
||||||
|
|
||||||
- ❌ Remove your device from Apple Business Manager — only the organization can do that
|
|
||||||
- ❌ Modify the signed system volume (SSV)
|
|
||||||
- ❌ Run `profiles renew` (which would re-enroll the device)
|
|
||||||
- ❌ Wipe data or erase content
|
|
||||||
|
|
||||||
### Known Limitations
|
|
||||||
|
|
||||||
| Limitation | Workaround |
|
|
||||||
|------------|------------|
|
|
||||||
| After macOS update, daemons may re-enable | Run `unleash suppress` again |
|
|
||||||
| Hosts file can be bypassed by cached DNS | Use `dscacheutil -flushcache` |
|
|
||||||
| IPv6 may not be blocked if only IPv4 entries added | Unleash adds both (:: and 0.0.0.0) |
|
|
||||||
| Migration Assistant carries MDM state | Use the three-phase solution above |
|
|
||||||
| `profiles status` shows enrollment | This is the SSV's view; daemon disable takes precedence |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## FAQ
|
|
||||||
|
|
||||||
**Q: What macOS versions are supported?**
|
|
||||||
A: macOS 12.x (Monterey) through 15.x (Sequoia) and 26.x (Tahoe). Tested on Intel T2, M1, M2, M3, and M4 hardware.
|
|
||||||
|
|
||||||
**Q: Do I need to disable SIP?**
|
|
||||||
A: No. All operations target the Data volume, which does not require SIP to be disabled.
|
|
||||||
|
|
||||||
**Q: Will this survive an OS reinstall?**
|
|
||||||
A: No. A fresh install clears the Data volume. You must re-run Unleash after reinstalling macOS.
|
|
||||||
|
|
||||||
**Q: Can the organization still track this device?**
|
|
||||||
A: The serial number remains in ABM. If the device connects to the internet and the MDM daemon re-enables, it will re-enroll. This is why the daemon disable and hosts block are both needed.
|
|
||||||
|
|
||||||
**Q: What if I need iCloud or App Store?**
|
|
||||||
A: The hosts block is broad. Use a per-app firewall (Little Snitch, LuLu) for selective blocking instead.
|
|
||||||
|
|
||||||
**Q: Why does MDM come back after Migration Assistant?**
|
|
||||||
A: Because MA copies user-level MDM caches, preferences, and launch agents. See [Migration Assistant section](#migration-assistant--known-failure-mode).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Build standalone (bundles all lib/ into one file)
|
|
||||||
bash examples/build-standalone.sh
|
|
||||||
|
|
||||||
# Test the suppress logic
|
|
||||||
sudo ./unleash suppress --dry-run
|
|
||||||
```
|
|
||||||
|
|
||||||
### Pull Requests
|
|
||||||
|
|
||||||
Contributions welcome, especially for:
|
|
||||||
- Additional MDM domains to block
|
|
||||||
- New launch daemon labels discovered on newer macOS versions
|
|
||||||
- Migration Assistant detection logic
|
|
||||||
- iCloud/MDM domain whitelist for selective blocking
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
||||||
|
|
||||||
- [Open issues](https://github.com/mateussiqueira/unleash/issues) for bugs and features
|
|
||||||
- Submit PRs with ShellCheck-validated code
|
|
||||||
- Test on your hardware and report compatibility
|
|
||||||
- Read the [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT. See [LICENSE](LICENSE).
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# unleash/lib/backup.sh — Backup and restore engine
|
|
||||||
|
|
||||||
BACKUP_DIR="$(dirname "$(dirname "$0")")/.unleash-backup"
|
BACKUP_DIR="$(dirname "$(dirname "$0")")/.unleash-backup"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# unleash/lib/colors.sh — UI helpers and color system
|
|
||||||
|
|
||||||
RED='\033[1;31m'
|
RED='\033[1;31m'
|
||||||
GRN='\033[1;32m'
|
GRN='\033[1;32m'
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# unleash/lib/detect.sh — Volume, mode, and environment detection
|
|
||||||
|
|
||||||
is_recovery() {
|
is_recovery() {
|
||||||
[ -d "/System/Installation" ] && return 0
|
[ -d "/System/Installation" ] && return 0
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# unleash/lib/dscl.sh — Directory Services operations
|
|
||||||
|
|
||||||
dscl_node() {
|
dscl_node() {
|
||||||
local data_mount="$1"
|
local data_mount="$1"
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# unleash/lib/firewall.sh — pf firewall management for MDM blocking
|
|
||||||
|
|
||||||
FIREWALL_ANCHOR="com.unleash/mdm"
|
FIREWALL_ANCHOR="com.unleash/mdm"
|
||||||
FIREWALL_CONF="/etc/pf.conf"
|
FIREWALL_CONF="/etc/pf.conf"
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# unleash/lib/harden.sh — Live-OS hardening post-bypass
|
|
||||||
|
|
||||||
harden_live_os() {
|
harden_live_os() {
|
||||||
step "Killing running MDM processes..."
|
step "Killing running MDM processes..."
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# unleash/lib/heal.sh — Self-healing and boot persistence
|
|
||||||
|
|
||||||
heal_suppress() {
|
heal_suppress() {
|
||||||
local data_mount="$1"
|
local data_mount="$1"
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# unleash/lib/status.sh — Verify and status check
|
|
||||||
|
|
||||||
check_mdm_status() {
|
check_mdm_status() {
|
||||||
local data_mount="$1"
|
local data_mount="$1"
|
||||||
|
|||||||
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
# unleash/lib/suppress.sh — Core MDM suppression logic
|
|
||||||
# All paths target the Data volume (SSV-safe).
|
|
||||||
|
|
||||||
PB=/usr/libexec/PlistBuddy
|
PB=/usr/libexec/PlistBuddy
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# unleash/lib/validate.sh — Input validation helpers
|
|
||||||
|
|
||||||
validate_username() {
|
validate_username() {
|
||||||
local u="$1"
|
local u="$1"
|
||||||
|
|||||||
+10
-55
@@ -1,43 +1,5 @@
|
|||||||
# unleash/lib/whitelist.sh — Selective Apple services whitelist
|
MDM_BLOCKLIST="mdmenrollment.apple.com deviceenrollment.apple.com iprofiles.apple.com"
|
||||||
|
|
||||||
# Domains needed for iCloud, App Store, and system updates
|
|
||||||
readonly ICLOUD_DOMAINS=(
|
|
||||||
"apple.com"
|
|
||||||
"icloud.com"
|
|
||||||
"icloud.apple.com"
|
|
||||||
"setup.icloud.com"
|
|
||||||
"gsa.apple.com"
|
|
||||||
"appleid.apple.com"
|
|
||||||
"idmsa.apple.com"
|
|
||||||
"keyvalueservice.icloud.com"
|
|
||||||
"ckdatabase.icloud.com"
|
|
||||||
"ckdevices.icloud.com"
|
|
||||||
)
|
|
||||||
|
|
||||||
readonly APPSTORE_DOMAINS=(
|
|
||||||
"itunes.apple.com"
|
|
||||||
"apps.apple.com"
|
|
||||||
"appstoreconnect.apple.com"
|
|
||||||
"buy.itunes.apple.com"
|
|
||||||
"sandbox.itunes.apple.com"
|
|
||||||
)
|
|
||||||
|
|
||||||
readonly UPDATES_DOMAINS=(
|
|
||||||
"swscan.apple.com"
|
|
||||||
"swcdn.apple.com"
|
|
||||||
"swdist.apple.com"
|
|
||||||
"gdmf.apple.com"
|
|
||||||
"ns.itunes.apple.com"
|
|
||||||
)
|
|
||||||
|
|
||||||
# MDM domains that MUST remain blocked
|
|
||||||
readonly MDM_BLOCKLIST=(
|
|
||||||
"mdmenrollment.apple.com"
|
|
||||||
"deviceenrollment.apple.com"
|
|
||||||
"iprofiles.apple.com"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Selective pf rules: block only MDM, allow Apple services
|
|
||||||
install_selective_block() {
|
install_selective_block() {
|
||||||
local data_mount="$1"
|
local data_mount="$1"
|
||||||
local root=""
|
local root=""
|
||||||
@@ -49,15 +11,15 @@ install_selective_block() {
|
|||||||
local anchor_file="${anchor_dir}/com.unleash.selective"
|
local anchor_file="${anchor_dir}/com.unleash.selective"
|
||||||
mkdir -p "$anchor_dir"
|
mkdir -p "$anchor_dir"
|
||||||
|
|
||||||
cat > "$anchor_file" << 'ANCHOR'
|
> "$anchor_file"
|
||||||
# Unleash selective MDM block — blocks only MDM enrollment endpoints
|
|
||||||
# Allows iCloud, App Store, and system updates through.
|
|
||||||
ANCHOR
|
|
||||||
|
|
||||||
local d
|
for d in $MDM_BLOCKLIST; do
|
||||||
for d in "${MDM_BLOCKLIST[@]}"; do
|
for ip in $(host -t a "$d" 2>/dev/null | awk '/has address/{print $NF}'); do
|
||||||
echo "block drop out proto {tcp,udp} to {\$(host -t a \"$d\" 2>/dev/null | awk '/has address/{print \$NF}')}" >> "$anchor_file"
|
echo "block drop out proto {tcp,udp} to {$ip}" >> "$anchor_file"
|
||||||
echo "block drop out proto {tcp,udp} to {\$(host -t aaaa \"$d\" 2>/dev/null | awk '/has IPv6 addr/{print \$NF}')}" >> "$anchor_file"
|
done
|
||||||
|
for ip in $(host -t aaaa "$d" 2>/dev/null | awk '/has IPv6 addr/{print $NF}'); do
|
||||||
|
echo "block drop out proto {tcp,udp} to {$ip}" >> "$anchor_file"
|
||||||
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
chmod 644 "$anchor_file"
|
chmod 644 "$anchor_file"
|
||||||
@@ -79,7 +41,6 @@ ANCHOR
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
cat > "$pf_conf" <<- EOF
|
cat > "$pf_conf" <<- EOF
|
||||||
# pf.conf — restored by unleash (selective mode)
|
|
||||||
scrub-anchor "com.apple/*"
|
scrub-anchor "com.apple/*"
|
||||||
nat-anchor "com.apple/*"
|
nat-anchor "com.apple/*"
|
||||||
rdr-anchor "com.apple/*"
|
rdr-anchor "com.apple/*"
|
||||||
@@ -104,15 +65,9 @@ restore_hosts_based_block() {
|
|||||||
local data_mount="$1"
|
local data_mount="$1"
|
||||||
local root=""
|
local root=""
|
||||||
[ -n "$data_mount" ] && root="$data_mount"
|
[ -n "$data_mount" ] && root="$data_mount"
|
||||||
|
|
||||||
local hosts="${root}/private/etc/hosts"
|
local hosts="${root}/private/etc/hosts"
|
||||||
step "Restoring hosts-based block (leaving unleashes entries)..."
|
|
||||||
|
|
||||||
if [ -f "$hosts" ]; then
|
if [ -f "$hosts" ] && grep -q "Added by unleash" "$hosts" 2>/dev/null; then
|
||||||
if grep -q "Added by unleash" "$hosts" 2>/dev/null; then
|
|
||||||
info "unleash hosts entries intact"
|
info "unleash hosts entries intact"
|
||||||
else
|
|
||||||
info "No unleash hosts entries found"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# unleash — Unified MDM bypass tool for macOS.
|
# Single-script MDM bypass for macOS. Recovery mode. Apple Silicon + Intel.
|
||||||
# One script to rule them all: bypass, suppress, backup, restore, dualboot, status.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# ./unleash Interactive menu (auto-detects Recovery/dualboot)
|
|
||||||
# ./unleash bypass Full bypass (create admin + suppress)
|
|
||||||
# ./unleash suppress Suppress-only (no user created)
|
|
||||||
# ./unleash heal Check and re-apply suppression (auto-heal)
|
|
||||||
# ./unleash persist Install LaunchDaemon for boot-time persistence
|
|
||||||
# ./unleash unpersist Remove the persistence LaunchDaemon
|
|
||||||
# ./unleash firewall Block Apple MDM IP ranges via pf (kernel-level)
|
|
||||||
# ./unleash firewall-off Remove pf firewall MDM block
|
|
||||||
# ./unleash harden Live-OS hardening (kill MDM, remove profiles)
|
|
||||||
# ./unleash audit Deep MDM audit (profiles, certs, agents, processes)
|
|
||||||
# ./unleash whitelist Selective block (block MDM only, keep iCloud/App Store)
|
|
||||||
# ./unleash backup Backup current state
|
|
||||||
# ./unleash restore Restore from backup
|
|
||||||
# ./unleash dualboot Target a different volume (needs sudo)
|
|
||||||
# ./unleash status Check current MDM status
|
|
||||||
# ./unleash version Show version
|
|
||||||
#
|
|
||||||
# Put this on an external SSD and run from Recovery.
|
|
||||||
# No curl, no downloads, no typing URLs.
|
|
||||||
|
|
||||||
VERSION="1.1.0"
|
VERSION="1.1.0"
|
||||||
|
|
||||||
# Determine script location (works with symlinks and source)
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
LIB_DIR="$SCRIPT_DIR/lib"
|
LIB_DIR="$SCRIPT_DIR/lib"
|
||||||
|
|
||||||
# Source library modules
|
|
||||||
for _lib in colors detect validate dscl suppress backup status heal firewall harden whitelist; do
|
for _lib in colors detect validate dscl suppress backup status heal firewall harden whitelist; do
|
||||||
_lib_path="$LIB_DIR/$_lib.sh"
|
_lib_path="$LIB_DIR/$_lib.sh"
|
||||||
if [ -f "$_lib_path" ]; then
|
if [ -f "$_lib_path" ]; then
|
||||||
@@ -43,9 +19,6 @@ for _lib in colors detect validate dscl suppress backup status heal firewall har
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
# Command handlers
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
cmd_version() {
|
cmd_version() {
|
||||||
echo "unleash v$VERSION"
|
echo "unleash v$VERSION"
|
||||||
exit 0
|
exit 0
|
||||||
@@ -370,9 +343,6 @@ cmd_interactive_normal() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
# CLI dispatch
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
main() {
|
main() {
|
||||||
case "${1:-}" in
|
case "${1:-}" in
|
||||||
bypass) cmd_bypass ;;
|
bypass) cmd_bypass ;;
|
||||||
@@ -391,7 +361,7 @@ main() {
|
|||||||
status) cmd_status ;;
|
status) cmd_status ;;
|
||||||
version|-v|--version) cmd_version ;;
|
version|-v|--version) cmd_version ;;
|
||||||
help|-h|--help)
|
help|-h|--help)
|
||||||
head -50 "$0" | grep -E '^# |^# \$'
|
echo "Usage: $0 {bypass|suppress|heal|persist|unpersist|firewall|firewall-off|harden|audit|whitelist|backup|restore|dualboot|status|version|help}"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
"")
|
"")
|
||||||
|
|||||||
Reference in New Issue
Block a user