The current standalone_root_pw_reset script manipulates config.boot using raw awk/sed text substitution to set encrypted-password and clear plaintext-password for a given user. This approach is fragile - it relies on matching indentation and formatting patterns, and bypasses the VyOS config layer entirely.
Rewrite the password manipulation logic using VyOS Python libraries (vyos.configtree or equivalent) so that config.boot is parsed and modified as a structured config tree rather than as raw text.
References: