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

pridano generovani konfiguracniho souboru pro wardenWatchdog ze sablony;...

pridano generovani konfiguracniho souboru pro wardenWatchdog ze sablony; zprehledneni kodu; uprava mazani zkopirovanych sablon konfiguracnich souboru pri instalaci
parent 2ccf5d58
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ usage() ...@@ -23,7 +23,7 @@ usage()
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 -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 -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 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
...@@ -90,7 +90,7 @@ paramsChck() ...@@ -90,7 +90,7 @@ paramsChck()
oldPackageChck() oldPackageChck()
{ {
echo -n "Checking previous Warden server installation ... " echo -n "Checking previous Warden server installation ... "
old_package_version_file=`find $basedir -name package_version` old_package_version_file=$(find $basedir -name package_version)
if [ -f "$old_package_version_file" ]; then if [ -f "$old_package_version_file" ]; then
echo "FAILED!" echo "FAILED!"
echo echo
...@@ -118,7 +118,7 @@ perlChck() ...@@ -118,7 +118,7 @@ perlChck()
modulesChck() modulesChck()
{ {
sed '/^use [A-Z]/!d; /Warden/d' `find "${dirname}" -type f` 2>/dev/null | cut -f 2 -d " " | sed 's/;//' | sort -u > "$modules_file" sed '/^use [A-Z]/!d; /Warden/d' $(find "${dirname}" -type f) 2>/dev/null | cut -f 2 -d " " | sed 's/;//' | sort -u > "$modules_file"
for module in $(<"$modules_file"); for module in $(<"$modules_file");
do do
echo -n "Checking $module module ... " echo -n "Checking $module module ... "
...@@ -138,7 +138,7 @@ createWardenDir() ...@@ -138,7 +138,7 @@ createWardenDir()
fi fi
done done
ln -s "${sh}/uninstall.sh" "$basedir" ln -s "${sh}/uninstall.sh" "$basedir"
rm -f "${etc}/${server_conf_tmpl##*/}" "${etc}/${apache_conf_tmpl##*/}" rm -f "${etc}/"*.tmpl
echo "OK" echo "OK"
} }
...@@ -192,6 +192,7 @@ paramsChck ...@@ -192,6 +192,7 @@ paramsChck
# set variables # set variables
err="/tmp/warden-err" err="/tmp/warden-err"
modules_file="/tmp/warden-modules.txt" modules_file="/tmp/warden-modules.txt"
hostname=$(hostname -f || echo "unspecified.server")
dirname=${0%/*} dirname=${0%/*}
bin="${basedir}/bin" bin="${basedir}/bin"
lib="${basedir}/lib" lib="${basedir}/lib"
...@@ -200,8 +201,10 @@ etc="${basedir}/etc" ...@@ -200,8 +201,10 @@ etc="${basedir}/etc"
sh="${basedir}/sh" sh="${basedir}/sh"
server_conf="${etc}/warden-server.conf" server_conf="${etc}/warden-server.conf"
apache_conf="${etc}/warden-apache.conf" apache_conf="${etc}/warden-apache.conf"
watchdog_conf="${etc}/warden-watchdog.conf"
server_conf_tmpl="${dirname}/etc/warden-server.conf.tmpl" server_conf_tmpl="${dirname}/etc/warden-server.conf.tmpl"
apache_conf_tmpl="${dirname}/etc/warden-apache.conf.tmpl" apache_conf_tmpl="${dirname}/etc/warden-apache.conf.tmpl"
watchdog_conf_tmpl="${dirname}/etc/warden-watchdog.conf.tmpl"
package_version=$(< "${dirname}/etc/package_version") package_version=$(< "${dirname}/etc/package_version")
echo echo
...@@ -239,6 +242,13 @@ doTemplate \ ...@@ -239,6 +242,13 @@ doTemplate \
< $apache_conf_tmpl \ < $apache_conf_tmpl \
> $apache_conf && echo "OK" || errClean > $apache_conf && echo "OK" || errClean
# create wardenWatchdog configuration file
echo -n "Creating wardenWatchdog configuration file ... "
doTemplate \
_HOSTNAME_ "$hostname" \
< $watchdog_conf_tmpl \
> $watchdog_conf && echo "OK" || errClean
# crate symlinks from warden server bin to user path if -s option is set # crate symlinks from warden server bin to user path if -s option is set
[[ ! -z $symbin ]] && [[ -d $symbin ]] && [[ -w $symbin ]] && createSymlinks [[ ! -z $symbin ]] && [[ -d $symbin ]] && [[ -w $symbin ]] && createSymlinks
......
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