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

zmena verze skriptu; pridana kontrola nainstalovaneho klienta; zmena odsazeni

parent ae775364
Branches
Tags
No related merge requests found
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
# otherwise) arising in any way out of the use of this software, even # otherwise) arising in any way out of the use of this software, even
# if advised of the possibility of such damage. # if advised of the possibility of such damage.
VERSION="1.1.0" VERSION="1.1"
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# FUNCTIONS # FUNCTIONS
...@@ -69,7 +69,7 @@ err() ...@@ -69,7 +69,7 @@ err()
cat $err cat $err
rm -rf $err rm -rf $err
echo echo
echo "Installation of $package_name package FAILED!!!" echo "Installation of $package_version package FAILED!!!"
exit 1 exit 1
} }
...@@ -82,7 +82,7 @@ err_clean() ...@@ -82,7 +82,7 @@ err_clean()
cat $err cat $err
rm -rf $err rm -rf $err
echo echo
echo "Installation of $package_name package FAILED!!!" echo "Installation of $package_version package FAILED!!!"
exit 1 exit 1
} }
...@@ -141,6 +141,17 @@ params_chck() ...@@ -141,6 +141,17 @@ params_chck()
} }
old_client_chck()
{
old_package_version="$etc/package_version.txt"
if [ -f $old_package_version ]; then
echo "Sorry, but $old_package_version package is installed!"
echo "For update of warden client package please use update.sh script."
exit 1
fi
}
perl_chck() perl_chck()
{ {
echo -n "Checking Perl interpreter ... " echo -n "Checking Perl interpreter ... "
...@@ -186,7 +197,7 @@ installation_dir_chck() ...@@ -186,7 +197,7 @@ installation_dir_chck()
make_warden_dir() make_warden_dir()
{ {
echo -n "Creating warden client directory ... " echo -n "Creating warden client directory ... "
cp -R `dirname $0`/warden-client $prefix 2> $err; ret_val=`echo $?` cp -R $dirname/warden-client $prefix 2> $err; ret_val=`echo $?`
if [ $ret_val -eq 0 ]; then if [ $ret_val -eq 0 ]; then
echo "OK" echo "OK"
else else
...@@ -196,9 +207,9 @@ make_warden_dir() ...@@ -196,9 +207,9 @@ make_warden_dir()
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 -u "`dirname $0`/$file" "$client_path/doc" cp -u $dirname/$file "$client_path/doc"
done done
cp -u "`dirname $0`/uninstall.sh" "$client_path" cp -u $dirname/uninstall.sh "$client_path"
} }
...@@ -253,6 +264,7 @@ echo "# ...@@ -253,6 +264,7 @@ echo "#
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
\$SSL_CA_FILE = \"$ca_file\"; \$SSL_CA_FILE = \"$ca_file\";
" > $conf_file 2> $err; ret_val=`echo $?` " > $conf_file 2> $err; ret_val=`echo $?`
if [ $ret_val -eq 0 ]; then if [ $ret_val -eq 0 ]; then
echo "OK" echo "OK"
else else
...@@ -308,7 +320,8 @@ root_chck ...@@ -308,7 +320,8 @@ root_chck
params_chck params_chck
# create variables # create variables
package_name="warden-client-$VERSION" dirname=`dirname $0`
package_version=`cat $dirname/warden-client/etc/package_version.txt`
key_file=`basename $key` key_file=`basename $key`
cert_file=`basename $cert` cert_file=`basename $cert`
client_path="$prefix/warden-client" client_path="$prefix/warden-client"
...@@ -316,6 +329,9 @@ etc="$client_path/etc" ...@@ -316,6 +329,9 @@ etc="$client_path/etc"
conf_file="$etc/warden-client.conf" conf_file="$etc/warden-client.conf"
err="/tmp/warden-err" err="/tmp/warden-err"
# check if warden-client is installed
old_client_chck
echo echo
echo "------------------------- Dependencies check-in -------------------------" echo "------------------------- Dependencies check-in -------------------------"
...@@ -350,7 +366,7 @@ change_permissions ...@@ -350,7 +366,7 @@ change_permissions
echo echo
echo "Please check configuration file in $conf_file!" echo "Please check configuration file in $conf_file!"
echo echo
echo "Installation of $package_name package was SUCCESSFUL!!!" echo "Installation of $package_version package was SUCCESSFUL!!!"
# cleanup section # cleanup section
rm -rf $err rm -rf $err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment