From 21e06809b36b97f065311f00bedcc10aa070d550 Mon Sep 17 00:00:00 2001 From: Tom <116762865+Nestpebble@users.noreply.github.com> Date: Sun, 2 Feb 2025 14:30:50 +0000 Subject: [PATCH] add a case substitution function --- .../usr/local/bin/femto-usb-config-tool.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh index 3b706fe..2322042 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh @@ -49,6 +49,10 @@ escape_sed() { echo "$1" | sed -e 's/[]\/$*.^[]/\\&/g' } +case_sed() { + echo "$1" | sed 's/.*/\L&/' +} + # Check if the mount point exists and if a USB drive is plugged in usb_path=$(lsblk -o NAME,FSTYPE,SIZE,TYPE,MOUNTPOINT | grep -E "vfat|ext4|ntfs|exfat" | grep -E "sd[a-z]([0-9]*)" | awk '{print $1}' | sed 's/[^a-zA-Z0-9]//g' | head -n 1) full_device_path="/dev/$usb_path" # Construct the full device path