title: How to check for usb device with if statement in bash
body: <p>I'm attempting to create an automated bash script that fills up a file with urandom in the unit's flash storage. I can manually use all of the commands to make this happen, but I'm trying to create a script and having difficulty figuring out how to check for the usb device. I know that it will be either sda1 or sdb1, but not sure if the code below is sufficient ...? Thanks! Below, is the code:</p>
  
  <pre><code>if /dev/sda1
  then
           mount -t vfat /dev/sda1 /media/usbkey
  else
           mount -t vfat /dev/sdb1 /media/usbkey
  fi
  </code></pre>