fn: sgnd_need_root
Purpose
Require root privileges, restarting this executable through sudo if necessary.
Description
Preserves the Framework root and PATH, sets SGND_ALREADY_ROOT to prevent repeated escalation.
Arguments
$@— Original executable arguments to forward when restarting.
Side effects
May replace the running process with a sudo-launched invocation.
Returns
- 0 when already running as root; otherwise the restarted process determines the exit status.
Usage
sgnd_need_root "$@"
