On a side note:
Code:
if $(grep -q /dev/sdc1 /proc/mounts)
should be rather like
Code:
if grep -q /dev/sdc1 /proc/mounts; then
assuming one wants to check if sdc1 is mounted.
if cares for the exit status of grep (success or failur), not for the output grep gives.
to put it different:
Code:
grep root /etc/passwd; echo "exit code of grep: $?"
Code:
grep_var=$(grep root /etc/passwd); echo "result of grep: $grep_var"
If the script relies on the stick to be mounted, i would make it exit in case the mount fails:
Code:
mount -U 84B46F79B46F6C9C /mnt/wd || exit 1
|| also tests for the exit code, if the previous command failed, || will make exit 1 be executed (like or: either the right side of || will succeed, or the left side will be executed).
If this is too confusing (and it sure doesn't help much with the actual problem, just test for a successfull execution of mount with if-fi, and exit if mount failed).