From 53e78ebba12db5fa08bb7f7406dea8c85847598f Mon Sep 17 00:00:00 2001
From: Tomas Plesnik <plesnik@ics.muni.cz>
Date: Fri, 23 May 2014 16:08:37 +0200
Subject: [PATCH] pridan parametr -e pro nastaveni kontaktniho mailu na spravce
 Warden serveru

---
 src/warden-server/sh/install.sh | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/warden-server/sh/install.sh b/src/warden-server/sh/install.sh
index 866aca1..5fbd6ad 100755
--- a/src/warden-server/sh/install.sh
+++ b/src/warden-server/sh/install.sh
@@ -19,11 +19,12 @@ usage()
 	echo "-k <ssl_key_file>         path to SSL certificate key file"
 	echo "-c <ssl_cert_file>        path to SSL certificate file"
 	echo "-a <ssl_ca_file>          path to CA certificate file"
+	echo "-e <e-mail address>       e-mail address to Warden server administrator"
 	echo "-s <directory>            directory for symlinks to Warden server control scripts (optional)"
 	echo "-h                        print this help"
 	echo "-V                        print script version number and exit"
 	echo
-	echo "Example: $ ./${0##*/} -d /opt/warden-server -k /etc/ssl/private/server.key -c /etc/ssl/certs/server.pem -a /etc/ssl/certs/tcs-ca-bundle.pem -s /usr/local/bin"
+	echo "Example: $ ./${0##*/} -d /opt/warden-server -k /etc/ssl/private/server.key -c /etc/ssl/certs/server.pem -a /etc/ssl/certs/tcs-ca-bundle.pem -e admin@domain.com -s /usr/local/bin"
 	echo
 	echo "For more information about installation process, see README file (section Installation)."
 	echo
@@ -87,6 +88,10 @@ paramsChck()
 		echo "Parameter -a <ssl_ca_file> is not set!"
 		exit 1
 	fi
+	if [ -z "$contact" ]; then
+		echo "Parameter -e <e-mail address> is not set!"
+		exit 1
+	fi
 }
 
 
@@ -185,12 +190,13 @@ createSymlinks()
 #				MAIN
 #-------------------------------------------------------------------------------
 # read input
-while getopts "d:k:c:a:s:Vh" options; do
+while getopts "d:k:c:a:e:s:Vh" options; do
 	case "$options" in
 		d ) basedir="$OPTARG";;
 		k ) key_file="$OPTARG";;
 		c ) cert_file="$OPTARG";;
 		a ) ca_file="$OPTARG";;
+		e ) contact="$OPTARG";;
 		s ) symbin="$OPTARG";;
 		h ) usage;;
 		V ) version;;
@@ -263,6 +269,7 @@ doTemplate \
 echo -n "Creating Warden Watchdog configuration file ... "
 doTemplate \
         _HOSTNAME_	"$hostname" \
+        _CONTACT_	"$contact" \
         < $watchdog_conf_tmpl \
         > $watchdog_conf && echo "OK" || errClean
 
-- 
GitLab