#! /bin/bash
# switches off NAS disk if NAS ist not mounted

NAS="80b19694-d431-44fe-ad73-8862ca9c7c49"

# Get the 'real' devicename of the NAS disk
td=$(/bin/readlink -e /dev/disk/by-uuid/$NAS) || exit
if ! grep -qs $td /proc/mounts; then
	logger "powering off nas disk"
	/usr/local/bin/relay 0 off
fi
