#!/bin/bash if [ "$1" == "unmount" ] then MOUNT=`mount | grep '/mnt/data'` if [ -n "$MOUNT" ] then echo "Unmounting /mnt/data" umount /mnt/data else echo "ERROR: /mnt/data is not mounted." fi else if [ -e /dev/sda4 ] then echo "Mounting /dev/sda4 as /mnt/data" mount /mnt/data else echo "ERROR: No HDD." exit 1 fi fi