#/bin/sh
usb_num=$(cat /proc/scsi/scsi | grep "Vendor" | wc -l)
if [ $usb_num = 2 ];then
echo "test usb success"
else
echo "test usb failed"
fi判断USB接口是否有设备插入,usb_num为检查到的USB设备个数。
原文地址:https://www.cnblogs.com/codeking100/p/10344074.html
时间: 2024-10-18 00:00:52