Adding duration calculation
Additional checks if image source is available
This commit is contained in:
@@ -1,8 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
mountedCheckFile="/home/network/Qbilder/photos/.mounted"
|
||||
catId=0
|
||||
subCatId=1
|
||||
|
||||
STARTTIME=$(date +%s)
|
||||
|
||||
# -s : file exists and has a size greater than zero
|
||||
if [ ! -s "$mountedCheckFile" ] ; then
|
||||
echo "[refresh] Network not available (exists: $mountedCheckFile)"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
# check if the file is really readable and contains text
|
||||
mounted=$(cat "$mountedCheckFile" 2>>/dev/null)
|
||||
if [ -z $mounted ] ; then
|
||||
echo "[refresh] Network not available (content: $montedCheckFile)"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ "$1" != "" ] && [ "$2" != "" ]
|
||||
then
|
||||
catId=$1
|
||||
@@ -20,3 +36,6 @@ perl -w /root/script/piwigo_refresh.pl \
|
||||
--privacy_level=4 \
|
||||
--cat=${catId} \
|
||||
--subcat=${subCatId}
|
||||
|
||||
ENDTIME=$(date +%s)
|
||||
echo "Refresh took: $((($ENDTIME - $STARTTIME)/60)) minutes"
|
||||
|
Reference in New Issue
Block a user