fix: use sudo test -s to verify extracted files in upgrade_kiosk

On Ubuntu 22.04+, useradd creates home directories with 750 permissions,
so the non-root user running the script cannot traverse /home/kiosk to
check file existence with [[ -s ]]. sudo tee (running as root) writes the
files successfully, but the bash test always returned false, falsely
reporting all extractions as failed.

Switch to `sudo test -s` to match the pattern already used elsewhere in
the script (line ~10320) when checking files under /home/kiosk.

https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr
This commit is contained in:
Claude
2026-04-20 23:10:47 +00:00
parent 06c00a5944
commit 07823423e5
+1 -1
View File
@@ -10823,7 +10823,7 @@ upgrade_kiosk() {
# Extract content and write to file (use sudo tee for reliability)
sed -n "${content_start},${content_end}p" "$script_path" | sudo tee "$output_file" > /dev/null
if [[ -s "$output_file" ]]; then
if sudo test -s "$output_file"; then
echo "$fname (lines $content_start-$content_end)"
return 0
else