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

provedena revize kodu

parent d4647723
No related branches found
No related tags found
No related merge requests found
...@@ -38,21 +38,21 @@ VERSION="1.1.0" ...@@ -38,21 +38,21 @@ VERSION="1.1.0"
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
usage() usage()
{ {
echo "Usage: `basename $0` [-d <directory>] [-u <user>] [-k <ssl_key_file>] [-c <ssl_cert_file>] [-a <ssl_ca_file>] [-hV]" echo "Usage: `basename $0` [-d <directory>] [-u <user>] [-k <ssl_key_file>] [-c <ssl_cert_file>] [-a <ssl_ca_file>] [-hV]"
echo "-d <directory> installation directory (default: /opt)" echo "-d <directory> installation directory (default: /opt)"
echo "-u <user> owner of warden client package (user for running detection scripts)" echo "-u <user> owner of warden client package (user for running detection scripts)"
echo "-k <ssl_key_file> path to SSL certificate key file" echo "-k <ssl_key_file> path to SSL certificate key file"
echo "-c <ssl_cert_file> path to SSL certificate file" echo "-c <ssl_cert_file> path to SSL certificate file"
echo "-a <ssl_ca_file> path to CA certificate file" echo "-a <ssl_ca_file> path to CA certificate file"
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: ./`basename $0` -d /opt -u detector -k /etc/ssl/private/client.key -c /etc/ssl/certs/client.pem -a /etc/ssl/certs/tcs-ca-bundle.pem" echo "Example: ./`basename $0` -d /opt -u detector -k /etc/ssl/private/client.key -c /etc/ssl/certs/client.pem -a /etc/ssl/certs/tcs-ca-bundle.pem"
echo echo
echo "Note: You must be root for running this script." echo "Note: You must be root for running this script."
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
exit 0 exit 0
} }
...@@ -67,6 +67,7 @@ err() ...@@ -67,6 +67,7 @@ err()
{ {
echo "FAILED!" echo "FAILED!"
cat $err cat $err
rm -rf $err
echo echo
echo "Installation FAILED!!!" echo "Installation FAILED!!!"
exit 1 exit 1
...@@ -119,7 +120,7 @@ params_chck() ...@@ -119,7 +120,7 @@ params_chck()
{ {
if [ -z $prefix ]; then if [ -z $prefix ]; then
prefix=/opt prefix=/opt
echo "Warning: parameter -d <directory> is not set - default installation directory is /opt!" echo "Warning: parameter -d <directory> is not set - default installation directory is $prefix!"
fi fi
if [ -z $user ]; then if [ -z $user ]; then
echo "Parameter -u <user> is not set!" echo "Parameter -u <user> is not set!"
...@@ -148,6 +149,7 @@ perl_chck() ...@@ -148,6 +149,7 @@ perl_chck()
echo "OK" echo "OK"
else else
echo "FAILED!" echo "FAILED!"
echo "Error: Perl interpreter is not installed!"
exit 1 exit 1
fi fi
} }
...@@ -162,7 +164,7 @@ modules_chck() ...@@ -162,7 +164,7 @@ modules_chck()
if [ $ret_val -eq 0 ]; then if [ $ret_val -eq 0 ]; then
echo "OK" echo "OK"
else else
err err
fi fi
done done
} }
...@@ -184,13 +186,13 @@ installation_dir_chck() ...@@ -184,13 +186,13 @@ installation_dir_chck()
make_warden_dir() make_warden_dir()
{ {
echo -n "Making warden client directory ... " echo -n "Making warden client directory ... "
cp CHANGELOG INSTALL LICENSE README "$client_path/doc"
cp -R ./warden-client $prefix 2> $err; ret_val=`echo $?` cp -R ./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
err_clean err_clean
fi fi
cp -u CHANGELOG INSTALL LICENSE README "$client_path/doc"
} }
......
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