Provide host, runtime, and operating-system utility helpers
Source: target-root/usr/local/lib/solidgroundux/common/sgnd-system.sh
Provide host, runtime, and operating-system utility helpers
Public functions
- Need root
- Cannot root
- Need systemd
- Need writable
- Is active
- Ensure writable dir
- Get primary nic
- Ping ok
- Port open
- Get ip
- Real user
- Real home
- Run as real user
- Fix ownership
- Fix permissions
- Get os
- Get os version
- Die
- Require
- Must
Internal functions
| Function | Purpose | Arguments | Output |
|---|---|---|---|
_sgnd_lib_guard | Ensure direct execution is rejected and record that the library has been sourced. | — | — |
Description
Contains environment-aware helpers that sit above sgnd-core.
The library:
- Provides root/sudo/runtime guards
- Exposes OS, network, and service-state helpers
- Includes ownership and permission normalization helpers
- Keeps operational/debug output close to procedural system actions
Design principles
- Keep system behavior out of sgnd-core
- Depend on framework bootstrap guarantees for minimal say* functions
- Prefer explicit operational helpers over mixing host logic into generic primitives
- Keep behavior predictable and side effects documented
Role in framework
- System/runtime layer above sgnd-core
- Used by installers, setup routines, and host-aware modules
- Centralizes platform and privilege helpers
Non-goals
- Business logic or application-specific behavior
- Interactive UI rendering or menu behavior
- Generic string/array/text helpers (handled in sgnd-core)
