diff --git a/src/warden-client/doc/README b/src/warden-client/doc/README index c4cc0c0a4cb31370a95e01d43877303a47228891..14e1221f1bcb65aa3cd437d4c8921d8698ec5894 100644 --- a/src/warden-client/doc/README +++ b/src/warden-client/doc/README @@ -63,7 +63,7 @@ B. Installation Dependencies SOAP::Transport::HTTP >= 0.712 FindBin >= 1.50 DateTime >= 0.61 - + Carp >= 1.11 -------------------------------------------------------------------------------- C. Installation (First installation of the Warden client package) diff --git a/src/warden-client/sh/install.sh b/src/warden-client/sh/install.sh index 70d1bae2d508d474537553ae7ca23925930721db..5d996ed174e494193be1447410a83e961dbdcc94 100755 --- a/src/warden-client/sh/install.sh +++ b/src/warden-client/sh/install.sh @@ -7,7 +7,7 @@ # Use of this source is governed by a BSD-style license, see LICENSE file. -VERSION="2.0" +VERSION="2.1" #------------------------------------------------------------------------------- # FUNCTIONS @@ -139,40 +139,40 @@ modules_chck() make_warden_dir() { echo -n "Creating warden client directory ... " - test -d $prefix || mkdir -p $prefix + test -d $prefix || mkdir -p prefix if cp -R ${dirname}/warden-client $prefix 2> $err; then echo "OK" else - err_clean + err_clean fi files=(CHANGELOG INSTALL LICENSE README README.cesnet) for file in ${files[@]}; do - cp ${dirname}/$file ${client_path}/doc + cp ${dirname}/warden-client/doc/$file ${client_path}/doc done - cp ${dirname}/uninstall.sh $client_path + cp ${dirname}/uninstall.sh ${client_path}/sh } -copy_key() +check_key() { - echo -n "Copying certificate key file ... " - if cp $key $etc 2> $err; then + echo -n "Checking certificate key file ... " + if su ${user} -c "test -r ${key}" 2> $err; then echo "OK" else - err_clean + echo "Warning: certificate key file is not readable by user ${user}!" fi } -copy_cert() +check_cert() { - echo -n "Copying certificate file ... " - if cp $cert $etc 2> $err; then + echo -n "Checking certificate file ... " + if su ${user} -c "test -r ${key}" 2> $err; then echo "OK" else - err_clean + echo "Warning: certificate file is not readable by user ${user}!" fi } @@ -192,12 +192,12 @@ make_conf_file() #------------------------------------------------------------------------------- # SSL_KEY_FILE - path to client SSL certificate key file #------------------------------------------------------------------------------- -\$SSL_KEY_FILE = \"${etc}/${key_file}\"; +\$SSL_KEY_FILE = \"${key}\"; #------------------------------------------------------------------------------- # SSL_CERT_FILE - path to client SSL certificate file #------------------------------------------------------------------------------- -\$SSL_CERT_FILE = \"${etc}/${cert_file}\"; +\$SSL_CERT_FILE = \"${cert}\"; #------------------------------------------------------------------------------- # SSL_CA_FILE - path to CA certificate file @@ -217,7 +217,6 @@ change_permissions() { echo -n "Changing permissions to installed package ... " chown -R $user: $client_path 2> $err || err_clean - chmod 400 ${etc}/$key_file ${etc}/$cert_file || err_clean chmod 644 ${etc}/package_version || err_clean if chmod 600 $conf_file; then echo "OK" @@ -233,8 +232,7 @@ change_permissions() #------------------------------------------------------------------------------- # list of used Perl modules -modules=(SOAP::Lite IO::Socket::SSL SOAP::Transport::HTTP FindBin DateTime) - +modules=(SOAP::Lite IO::Socket::SSL SOAP::Transport::HTTP FindBin DateTime Carp) # read input while getopts "d:u:k:c:a:Vh" options; do case $options in @@ -286,10 +284,10 @@ echo "------------------------- Installation process --------------------------" make_warden_dir # copy cert key file -copy_key +check_key # copy cert file -copy_cert +check_cert # create conf file make_conf_file