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:
parent
b76131ed1d
commit
1a1ca1794a
@ -75,8 +75,8 @@ cmd_publish() {
|
|||||||
log_info "Publishing: $file as $vhost"
|
log_info "Publishing: $file as $vhost"
|
||||||
|
|
||||||
# Detect file type by extension (file command not available on OpenWrt)
|
# Detect file type by extension (file command not available on OpenWrt)
|
||||||
# Strip any CR/LF that may come from Windows uploads or JSON parsing
|
# Use awk for lowercase - BusyBox tr '[:upper:]' '[:lower:]' is buggy
|
||||||
local file_ext=$(echo "$file" | sed 's/.*\.//' | tr '[:upper:]' '[:lower:]' | tr -d '\r\n')
|
local file_ext=$(echo "$file" | sed 's/.*\.//' | awk '{print tolower($0)}' | tr -d '\r\n')
|
||||||
|
|
||||||
if [ "$file_ext" = "zip" ]; then
|
if [ "$file_ext" = "zip" ]; then
|
||||||
log_info "Extracting ZIP..."
|
log_info "Extracting ZIP..."
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user