#!/bin/bash

if [ ! -e "/opt/pos/.hardlock" ]; then
  echo "No hardlock... aborting..."
  exit
fi

HARDLOCK_NAME=`cat /opt/pos/.hardlock | cut -f3 -d/`
HARDLOCK_PATH="/media/$HARDLOCK_NAME"
HARDLOCK_DEVICE=`mount | grep $HARDLOCK_PATH | awk '{ print $1 }'`

if [ "$HARDLOCK_DEVICE" != "" ]; then
  fsck.vfat -a $HARDLOCK_DEVICE
fi

