#!/bin/bash

# This is a simple installation script; it is not
# needed for JABS to works, it is just an example
# of how I'm currently using it.

# Shared NAS directory where extracted files live
# I extract the jabs.tar.gz into the BASEROOT.
# I use a NAS so I can share between ESX hosts.
# I use a NFS share so I can mount through vmkernel
# and Service Console. I'll use the vmkernel mount
# (/vmfs/volumes/<NFS share>) as SESSION_DESTINATION
# for maximum throughput. I'll use the Service Console
# mount (/export/sannas), mounted as ReadOnly, to
# CRON the script, so I can unmount it to completely
# disable the backup script on a specific host.

BASEROOT=/backup/nas

if ! [ -d "$BASEROOT/scripts/jabs/" ] ; then
	echo "Directory di destinazione non valida"
else
	rm -f /usr/local/bin/jabs
	rm -f /usr/local/bin/sendEmail
	ln -s $BASEROOT/scripts/jabs/jabs /usr/local/bin/jabs
	ln -s $BASEROOT/scripts/sendEmail/sendEmail /usr/local/bin/sendEmail

	echo "--------------------------------------------------------"
	echo "Installazione terminata."
	echo "Ricordati di configurare le variabili VCHOST, USERNAME e"
	echo "PASSWORD nel file /etc/vmware/backuptools.conf"
fi


