Commit 127c44a
committed
Use get_current_ip in update_motd_ip; BusyBox hostname has no -I
An Alpine update aborted after reporting success:
hostname: unrecognized option: I
in line 86: exit code 1: while executing command awk '{print $1}'
update_motd_ip built the profile file's IP with `hostname -I | awk '{print $1}'`,
which is GNU-specific. On Alpine hostname is BusyBox, the option does not exist,
and under pipefail the failing first stage took the whole update with it.
The same function already resolves the MOTD line's address with get_current_ip a
few lines above, and that helper has an explicit Alpine branch using `ip addr`.
So this is not a new capability, just the second site using the first one's
answer.
Surfaced because start() now reaches update_motd_ip at all: it had been dead code
behind every ct script's own exit, so this line had never run anywhere.
Checked the rest of the update path for the same class of problem. ssh_check's
`hostname -I` and arch_check's `dpkg --print-architecture` are host-side and not
reached. check_container_resources uses `free -m`, which BusyBox 1.37 supports --
the reported run got past it. run_addon_updates only globs /usr/local/bin.
Verified with a BusyBox-shaped hostname stub that fails on -I: the function
completes under set -euo pipefail and writes the correct address.1 parent a512bca commit 127c44a
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| |||
0 commit comments