Skip to content
Snippets Groups Projects
Commit 1573b625 authored by Jan Soukal's avatar Jan Soukal
Browse files

zmeny verze 2.1 zohledneny do install.sh. Zmena nakladani s certifikaty a klici.

parent 2c214e7c
Branches
Tags
No related merge requests found
...@@ -63,7 +63,7 @@ B. Installation Dependencies ...@@ -63,7 +63,7 @@ B. Installation Dependencies
SOAP::Transport::HTTP >= 0.712 SOAP::Transport::HTTP >= 0.712
FindBin >= 1.50 FindBin >= 1.50
DateTime >= 0.61 DateTime >= 0.61
Carp >= 1.11
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
C. Installation (First installation of the Warden client package) C. Installation (First installation of the Warden client package)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# Use of this source is governed by a BSD-style license, see LICENSE file. # Use of this source is governed by a BSD-style license, see LICENSE file.
VERSION="2.0" VERSION="2.1"
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# FUNCTIONS # FUNCTIONS
...@@ -139,40 +139,40 @@ modules_chck() ...@@ -139,40 +139,40 @@ modules_chck()
make_warden_dir() make_warden_dir()
{ {
echo -n "Creating warden client directory ... " 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 if cp -R ${dirname}/warden-client $prefix 2> $err; then
echo "OK" echo "OK"
else else
err_clean err_clean
fi fi
files=(CHANGELOG INSTALL LICENSE README README.cesnet) files=(CHANGELOG INSTALL LICENSE README README.cesnet)
for file in ${files[@]}; for file in ${files[@]};
do do
cp ${dirname}/$file ${client_path}/doc cp ${dirname}/warden-client/doc/$file ${client_path}/doc
done done
cp ${dirname}/uninstall.sh $client_path cp ${dirname}/uninstall.sh ${client_path}/sh
} }
copy_key() check_key()
{ {
echo -n "Copying certificate key file ... " echo -n "Checking certificate key file ... "
if cp $key $etc 2> $err; then if su ${user} -c "test -r ${key}" 2> $err; then
echo "OK" echo "OK"
else else
err_clean echo "Warning: certificate key file is not readable by user ${user}!"
fi fi
} }
copy_cert() check_cert()
{ {
echo -n "Copying certificate file ... " echo -n "Checking certificate file ... "
if cp $cert $etc 2> $err; then if su ${user} -c "test -r ${key}" 2> $err; then
echo "OK" echo "OK"
else else
err_clean echo "Warning: certificate file is not readable by user ${user}!"
fi fi
} }
...@@ -192,12 +192,12 @@ make_conf_file() ...@@ -192,12 +192,12 @@ make_conf_file()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# SSL_KEY_FILE - path to client SSL certificate key 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 - path to client SSL certificate file
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
\$SSL_CERT_FILE = \"${etc}/${cert_file}\"; \$SSL_CERT_FILE = \"${cert}\";
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# SSL_CA_FILE - path to CA certificate file # SSL_CA_FILE - path to CA certificate file
...@@ -217,7 +217,6 @@ change_permissions() ...@@ -217,7 +217,6 @@ change_permissions()
{ {
echo -n "Changing permissions to installed package ... " echo -n "Changing permissions to installed package ... "
chown -R $user: $client_path 2> $err || err_clean 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 chmod 644 ${etc}/package_version || err_clean
if chmod 600 $conf_file; then if chmod 600 $conf_file; then
echo "OK" echo "OK"
...@@ -233,8 +232,7 @@ change_permissions() ...@@ -233,8 +232,7 @@ change_permissions()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# list of used Perl modules # 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 # read input
while getopts "d:u:k:c:a:Vh" options; do while getopts "d:u:k:c:a:Vh" options; do
case $options in case $options in
...@@ -286,10 +284,10 @@ echo "------------------------- Installation process --------------------------" ...@@ -286,10 +284,10 @@ echo "------------------------- Installation process --------------------------"
make_warden_dir make_warden_dir
# copy cert key file # copy cert key file
copy_key check_key
# copy cert file # copy cert file
copy_cert check_cert
# create conf file # create conf file
make_conf_file make_conf_file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment