-1

I've found some information on this topic here. However, i get only so far.

What I need to do is the following:

Check every 5 min. if the network-drive is mounted. If YES, do nothing. If NO, mount disk and check if it is mounted. If YES, send email that all is ok. If NO, send email saying network-drive is unavailable.

I would really prefer to do this as a bash shell script.

Any pointer would be great.

rdpozo
  • 3
  • 1

1 Answers1

0

From How to send email from Terminal? article you'll find, how to send e-mails from shell.

After it just add simple check like:

if grep -qs '/mnt/foo ' /proc/mounts; then
   echo "It's mounted."
else
   echo "It's not mounted."
fi

...to the crontab: crontab -e

*/5 * * * * /path/to/your/script