This is an automated email from the ASF dual-hosted git repository.

pradeep pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 3e5ccd6  RANGER-2685 : check if there are files in ews/logs
3e5ccd6 is described below

commit 3e5ccd6c7892636a30ab3b1e96d79109b7915268
Author: joey.ljy <[email protected]>
AuthorDate: Mon Jan 6 19:18:09 2020 +0800

    RANGER-2685 : check if there are files in ews/logs
    
    Signed-off-by: Pradeep <[email protected]>
---
 security-admin/scripts/set_globals.sh  | 4 +++-
 unixauthservice/scripts/set_globals.sh | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/security-admin/scripts/set_globals.sh 
b/security-admin/scripts/set_globals.sh
index b0b400b..6660a47 100755
--- a/security-admin/scripts/set_globals.sh
+++ b/security-admin/scripts/set_globals.sh
@@ -104,7 +104,9 @@ ln -sf /etc/ranger/admin/conf 
ews/webapp/WEB-INF/classes/conf
 if [ ! -d /var/log/ranger/admin ]; then
        mkdir -p /var/log/ranger/admin
        if [ -d ews/logs ]; then
-               cp -r ews/logs/* /var/log/ranger/admin
+               if [ -n "$(ls ews/logs/ 2>/dev/null)" ]; then
+                       cp -r ews/logs/* /var/log/ranger/admin
+               fi
        fi
 fi
 
diff --git a/unixauthservice/scripts/set_globals.sh 
b/unixauthservice/scripts/set_globals.sh
index 7774e48..00eac9b 100755
--- a/unixauthservice/scripts/set_globals.sh
+++ b/unixauthservice/scripts/set_globals.sh
@@ -97,7 +97,9 @@ ln -sf /etc/ranger/usersync/conf conf
 if [ ! -d /var/log/ranger/usersync ]; then
        mkdir -p /var/log/ranger/usersync
        if [ -d ews/logs ]; then
-               cp -r ews/logs/* /var/log/ranger/usersync
+               if [ -n "$(ls ews/logs/ 2>/dev/null)" ]; then
+                       cp -r ews/logs/* /var/log/ranger/usersync
+               fi
        fi
 fi
 

Reply via email to