fix(droplet): Use awk for lowercase instead of buggy BusyBox tr

BusyBox tr '[:upper:]' '[:lower:]' has a bug that converts 'p' to 'w',
causing .zip to be detected as .ziw. Use awk tolower() instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-03-19 11:04:05 +01:00
parent b76131ed1d
commit 1a1ca1794a

View File

@ -75,8 +75,8 @@ cmd_publish() {
log_info "Publishing: $file as $vhost"
# Detect file type by extension (file command not available on OpenWrt)
# Strip any CR/LF that may come from Windows uploads or JSON parsing
local file_ext=$(echo "$file" | sed 's/.*\.//' | tr '[:upper:]' '[:lower:]' | tr -d '\r\n')
# Use awk for lowercase - BusyBox tr '[:upper:]' '[:lower:]' is buggy
local file_ext=$(echo "$file" | sed 's/.*\.//' | awk '{print tolower($0)}' | tr -d '\r\n')
if [ "$file_ext" = "zip" ]; then
log_info "Extracting ZIP..."