Appearance
Maintenance Commands
These commands handle diagnostics, upgrades, recovery, and lifecycle operations.
Which diagnostic command to use?
- Use
safecall system statusfor a quick passive snapshot (service/cron/monit/CLI wiring). - Use
safecall system selftestfor runtime health validation (mode-aware checks). - Use
safecall system doctorfor guided remediation (migration/update/repair prompts).
safecall system status
Shows operational status for service, monit, cron update job, and CLI symlink.
Usage
bash
sudo ./util.sh system statusUse this first when validating deployment health.
safecall system selftest
Runs deployment health checks.
Usage
bash
sudo ./util.sh system selftestWhat is checked
- required files (
safecall,util.sh,util.ts, config) - checksum integrity (
checksums.json) when present - config validity and expected keys
- version alignment (
/versionvsversion.txt) - database presence/readability/table structure
- HTTP endpoints and static files
- systemd service activity
- available disk space
safecall system doctor
Interactive diagnosis and guided remediation command.
Usage
bash
sudo ./util.sh system doctor
sudo ./util.sh system doctor --dir /opt/safecall-custom
sudo ./util.sh system doctor --offline-dir /path/to/offline-bundleOptions
| Option | Meaning |
|---|---|
--dir <directory> | Diagnose specific installation directory |
--offline-dir <path> | Use offline bundle for version/source decisions |
Behavior highlights
- Detects missing installation and prints install instructions.
- Detects pre-5.x layouts and offers migration via
repair --migrate. - Detects update availability and offers in-place update.
- Checks integrity mismatches and offers repair.
safecall system update
Performs in-place upgrade to latest version.
Usage
bash
sudo ./util.sh system update
sudo ./util.sh system update --offline-dir /path/to/offline-bundleBehavior highlights
- Runs pre-update selftest.
- Stops service, updates binary and CLI bundle, regenerates wrapper, refreshes checksums/version.
- Restarts service and runs post-update selftest.
safecall system repair
Rebuilds broken installation while preserving data/config where possible.
Usage
bash
sudo ./util.sh system repair
sudo ./util.sh system repair --migrate
sudo ./util.sh system repair --dir /opt/safecall-custom --offline-dir /path/to/offline-bundleOptions
| Option | Meaning |
|---|---|
--dir <directory> | Repair target install directory |
--migrate | Migrate legacy 4.x layout before repair |
--offline-dir <path> | Use offline bundle artifacts |
Behavior highlights
- Stops/disables old service, removes stale runtime files, reinstalls core files.
- Recreates systemd service and symlink.
- Runs post-repair selftest.
safecall system uninstall
Completely removes installation.
Usage
bash
sudo ./util.sh system uninstallBehavior highlights
- Stops/disables service, removes service unit, removes CLI symlink.
- Removes update cron entries (including legacy pattern).
- Deletes install directory.
safecall dev test
Wrapper command for test workflows.
Usage
bash
sudo ./util.sh dev test selftest
sudo ./util.sh dev test full
sudo ./util.sh dev test cleanOptions
| Option | Meaning |
|---|---|
selftest | Quick health check (same as system selftest) |
full | Run VM lifecycle suite |
clean | Remove test artifacts |
Hidden behavior
fulldelegates totest-vm.sh --quick(quick VM suite mode).- If
test-vm.shis missing, it tries known locations, then downloads it.
safecall dev generate util-sh (internal/advanced)
Regenerates the util.sh wrapper script.
Usage
bash
sudo ./util.sh dev generate util-shNotes
- Primarily used by install/update/repair flows automatically.
- Useful for manual recovery if wrapper script was modified or removed.