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

pridano vytvareni warden prefix adresare pokud pri instralaci neexistuje;...

pridano vytvareni warden prefix adresare pokud pri instralaci neexistuje; uzavorkovani pouzitych promennych v retezcich
parent a69354e4
No related branches found
No related tags found
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" VERSION="1.2"
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# FUNCTIONS # FUNCTIONS
...@@ -91,7 +91,7 @@ os_chck() ...@@ -91,7 +91,7 @@ os_chck()
{ {
OS=`uname` OS=`uname`
if [ "$OS" != "Linux" ]; then if [ "$OS" != "Linux" ]; then
echo "Sorry, unsupported operating system detected - \"$OS\"!" echo "Sorry, unsupported operating system detected - \"${OS}\"!"
exit 1 exit 1
fi fi
} }
...@@ -120,7 +120,7 @@ params_chck() ...@@ -120,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 $prefix!" 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!"
...@@ -143,7 +143,7 @@ params_chck() ...@@ -143,7 +143,7 @@ params_chck()
old_client_chck() old_client_chck()
{ {
old_package_version_file="$etc/package_version" old_package_version_file={$etc}/package_version
if [ -f $old_package_version_file ]; then if [ -f $old_package_version_file ]; then
old_package_version=`cat $old_package_version_file` old_package_version=`cat $old_package_version_file`
echo "Sorry, but $old_package_version package is installed!" echo "Sorry, but $old_package_version package is installed!"
...@@ -183,6 +183,7 @@ modules_chck() ...@@ -183,6 +183,7 @@ 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
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
...@@ -192,9 +193,9 @@ make_warden_dir() ...@@ -192,9 +193,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 ${dirname}/$file "${client_path}/doc" cp ${dirname}/$file ${client_path}/doc
done done
cp ${dirname}/uninstall.sh "$client_path" cp ${dirname}/uninstall.sh $client_path
} }
...@@ -347,7 +348,7 @@ make_conf_file ...@@ -347,7 +348,7 @@ make_conf_file
change_permissions change_permissions
echo echo
echo "Please check configuration file in $conf_file!" echo "Please check configuration file in ${conf_file}!"
echo echo
echo "Warden client directory: $client_path" echo "Warden client directory: $client_path"
echo echo
......
...@@ -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="0.1" VERSION="0.2"
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# FUNCTIONS # FUNCTIONS
...@@ -90,7 +90,7 @@ os_chck() ...@@ -90,7 +90,7 @@ os_chck()
{ {
OS=`uname` OS=`uname`
if [ "$OS" != "Linux" ]; then if [ "$OS" != "Linux" ]; then
echo "Sorry, unsupported operating system detected - \"$OS\"!" echo "Sorry, unsupported operating system detected - \"${OS}\"!"
exit 1 exit 1
fi fi
} }
...@@ -119,7 +119,7 @@ params_chck() ...@@ -119,7 +119,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 $prefix!" echo "Warning: parameter -d <directory> is not set - default installation directory is ${prefix}!"
fi fi
if [ -z $key ]; then if [ -z $key ]; then
echo "Parameter -k <ssl_key_file> is not set!" echo "Parameter -k <ssl_key_file> is not set!"
...@@ -138,7 +138,7 @@ params_chck() ...@@ -138,7 +138,7 @@ params_chck()
old_package_chck() old_package_chck()
{ {
old_package_version_file="$etc/package_version" old_package_version_file="${etc}/package_version"
if [ -f $old_package_version_file ]; then if [ -f $old_package_version_file ]; then
old_package_version=`cat $old_package_version_file` old_package_version=`cat $old_package_version_file`
echo "Sorry, but $old_package_version package is installed!" echo "Sorry, but $old_package_version package is installed!"
...@@ -189,7 +189,8 @@ modules_chck() ...@@ -189,7 +189,8 @@ modules_chck()
make_warden_dir() make_warden_dir()
{ {
echo -n "Creating warden server directory ... " echo -n "Creating warden server directory ... "
if cp -R $dirname/warden-server $prefix 2> $err; then test -d $prefix || mkdir -p $prefix
if cp -R ${dirname}/warden-server $prefix 2> $err; then
echo "OK" echo "OK"
else else
err_clean err_clean
...@@ -198,9 +199,9 @@ make_warden_dir() ...@@ -198,9 +199,9 @@ make_warden_dir()
files=(CHANGELOG INSTALL LICENSE README) files=(CHANGELOG INSTALL LICENSE README)
for file in ${files[@]}; for file in ${files[@]};
do do
cp $dirname/$file $server_path/doc cp ${dirname}/$file $server_path/doc
done done
cp $dirname/uninstall.sh $server_path cp ${dirname}/uninstall.sh $server_path
} }
...@@ -417,8 +418,8 @@ create_db ...@@ -417,8 +418,8 @@ create_db
create_symlinks create_symlinks
echo echo
echo "Please check client configuration file in $client_conf!" echo "Please check client configuration file in ${client_conf}!"
echo "Please check server configuration file in $server_conf!" echo "Please check server configuration file in ${server_conf}!"
echo echo
echo "Warden server directory: $server_path" echo "Warden server directory: $server_path"
echo "Warden server daemon: $init [start|stop|status|restart|force-stop]" echo "Warden server daemon: $init [start|stop|status|restart|force-stop]"
......
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