diff options
Diffstat (limited to 'etc/ncp-config.d/nc-format-USB.sh')
-rw-r--r-- | etc/ncp-config.d/nc-format-USB.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/ncp-config.d/nc-format-USB.sh b/etc/ncp-config.d/nc-format-USB.sh index e9981c84..d8bc0817 100644 --- a/etc/ncp-config.d/nc-format-USB.sh +++ b/etc/ncp-config.d/nc-format-USB.sh @@ -20,7 +20,7 @@ careful, this will destroy any data in the USB drive configure() { # count all disk devices except mmcblk0 - local NUM=$(( $( lsblk -l -n | grep -v zram | awk '{ print $6 }' | grep disk | wc -l ) - 1 )) + local NUM=$(( $( lsblk -ln | grep -v zram | awk '{ print $6 }' | grep disk | wc -l ) - 1 )) # only one plugged in [[ $NUM != 1 ]] && { @@ -40,7 +40,7 @@ configure() done # do it - local NAME=( $( lsblk -l -n | grep -v mmcblk | grep disk | awk '{ print $1 }' ) ) + local NAME=( $( lsblk -ln | grep -v -e mmcblk -e zram | grep disk | awk '{ print $1 }' ) ) [[ ${#NAME[@]} != 1 ]] && { echo "unexpected error"; return 1; } wipefs -a -f /dev/"$NAME" || return 1 |