Skip to content
Snippets Groups Projects
Commit f46333c2 authored by kaloyane's avatar kaloyane
Browse files

[LMS-2609] Removed dependency to GNU find. MacOS/FreeBSD support added.

SVN: 23491
parent 2bbf7af0
No related branches found
No related tags found
No related merge requests found
...@@ -8,13 +8,19 @@ ...@@ -8,13 +8,19 @@
# #
function fileAgeInSeconds() { function fileAgeInSeconds() {
FILE_NAME=$(basename $1) local fileName=$1
DIR_NAME=$(dirname $1)
# Linux-style stat command
fftime=$(find $DIR_NAME -name $FILE_NAME -type f -printf '%T@') fftime=$(stat -c "%Y" $fileName 2> /dev/null )
if [ $? -ne 0 ]; then
# error, perhaps we run on FreeBSD/MacOS ?
fftime=$(stat -f "%m" $fileName)
fi
nnow=$(date +%s) nnow=$(date +%s)
return $(expr $nnow - ${fftime%%\.*}) return $(expr $nnow - $fftime)
} }
STARTING_MESSAGE="STARTING SERVER" STARTING_MESSAGE="STARTING SERVER"
...@@ -54,7 +60,7 @@ jettyLogAgeInSeconds=5 ...@@ -54,7 +60,7 @@ jettyLogAgeInSeconds=5
# Loop while the openBIS process alters writes to the log files # Loop while the openBIS process alters writes to the log files
# #
while [ "$bisLogAgeInSeconds" -lt $TIMEOUT ] || [ "$jettyLogAgeInSeconds" -lt $TIMEOUT ]; do while [ "$bisLogAgeInSeconds" -lt $TIMEOUT ] || [ "$jettyLogAgeInSeconds" -lt $TIMEOUT ]; do
echo -n "." echo -n "."
sleep 2 sleep 2
......
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