iron out motd issues #14
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/motd.sh"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR Code Suggestions ✨
No code suggestions found for the PR.
/improve
PR Code Suggestions ✨
No code suggestions found for the PR.
/ask Check motd.sh, do you see any issues?
Ask❓
Check motd.sh, do you see any issues?
Answer:
Short answer:
No, the change you made to
motd.shis safe and improves robustness. The only real modification is adding double‑quotes around the variable expansions that split the service status lines. That prevents word‑splitting and globbing on thelabelandstatusvalues, which is exactly what you want.Below are a few points to keep in mind when reviewing the rest of the script (the diff you posted only shows the quoting change, but it’s worth double‑checking the surrounding logic):
printfformat string"$format_label_value"should contain exactly two%s(or equivalent) placeholders.$label:and$status) may not line up, leading to garbled output."$label:").serviceStatusLinesdoes not contain a colon,statuswill be empty.[[ $entry == *:* ]] && ….%characters,printfwill treat them as format specifiers.%, but if you ever do, you’ll need to escape them or useprintf '%s\n' "$status".motd.sh(andupdate.sh) has changed.Quick sanity check
If the output is as expected, the change is fine. If you see any unexpected word‑splitting or globbing, double‑check that all variables are quoted in the same way.
Bottom line: The quoted change is a good practice and should not introduce any regressions. No other issues are apparent from the diff snippet you provided. If you run the script in a staging environment and the MOTD renders correctly, you’re good to go.
WIP: iron out motd issuesto iron out motd issues