Skip to content
Snippets Groups Projects
Commit 53e78ebb authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

pridan parametr -e pro nastaveni kontaktniho mailu na spravce Warden serveru

parent ba0dfe0f
No related branches found
No related tags found
No related merge requests found
...@@ -19,11 +19,12 @@ usage() ...@@ -19,11 +19,12 @@ usage()
echo "-k <ssl_key_file> path to SSL certificate key file" echo "-k <ssl_key_file> path to SSL certificate key file"
echo "-c <ssl_cert_file> path to SSL certificate file" echo "-c <ssl_cert_file> path to SSL certificate file"
echo "-a <ssl_ca_file> path to CA 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 "-s <directory> directory for symlinks to Warden server control scripts (optional)"
echo "-h print this help" echo "-h print this help"
echo "-V print script version number and exit" echo "-V print script version number and exit"
echo 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
echo "For more information about installation process, see README file (section Installation)." echo "For more information about installation process, see README file (section Installation)."
echo echo
...@@ -87,6 +88,10 @@ paramsChck() ...@@ -87,6 +88,10 @@ paramsChck()
echo "Parameter -a <ssl_ca_file> is not set!" echo "Parameter -a <ssl_ca_file> is not set!"
exit 1 exit 1
fi fi
if [ -z "$contact" ]; then
echo "Parameter -e <e-mail address> is not set!"
exit 1
fi
} }
...@@ -185,12 +190,13 @@ createSymlinks() ...@@ -185,12 +190,13 @@ createSymlinks()
# MAIN # MAIN
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# read input # 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 case "$options" in
d ) basedir="$OPTARG";; d ) basedir="$OPTARG";;
k ) key_file="$OPTARG";; k ) key_file="$OPTARG";;
c ) cert_file="$OPTARG";; c ) cert_file="$OPTARG";;
a ) ca_file="$OPTARG";; a ) ca_file="$OPTARG";;
e ) contact="$OPTARG";;
s ) symbin="$OPTARG";; s ) symbin="$OPTARG";;
h ) usage;; h ) usage;;
V ) version;; V ) version;;
...@@ -263,6 +269,7 @@ doTemplate \ ...@@ -263,6 +269,7 @@ doTemplate \
echo -n "Creating Warden Watchdog configuration file ... " echo -n "Creating Warden Watchdog configuration file ... "
doTemplate \ doTemplate \
_HOSTNAME_ "$hostname" \ _HOSTNAME_ "$hostname" \
_CONTACT_ "$contact" \
< $watchdog_conf_tmpl \ < $watchdog_conf_tmpl \
> $watchdog_conf && echo "OK" || errClean > $watchdog_conf && echo "OK" || errClean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment