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