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:
@@ -10823,7 +10823,7 @@ upgrade_kiosk() {
|
|||||||
# Extract content and write to file (use sudo tee for reliability)
|
# 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
|
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)"
|
echo " ✓ $fname (lines $content_start-$content_end)"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user