Make the scripts configurable and provide example
This commit is contained in:
31
piwisync.sh
31
piwisync.sh
@@ -1,24 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
myyear=$(date "+%Y")
|
||||
# Get script working directory
|
||||
# (when called from a different directory)
|
||||
WDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >>/dev/null 2>&1 && pwd )"
|
||||
|
||||
if [ ! -s "$WDIR/config.sh" ] ; then
|
||||
echo "No configuration found"
|
||||
exit 1;
|
||||
fi
|
||||
. "$WDIR/config.sh"
|
||||
|
||||
myyear=$(date "+%Y")
|
||||
if [ "$1" != "" ]
|
||||
then
|
||||
myyear=$1
|
||||
#echo Error subdir parameter missing
|
||||
#exit 1;
|
||||
fi
|
||||
|
||||
subDir="$myyear/"
|
||||
piwigoThumbRoot="/var/www/piwigo/_data/i/network/network/${subDir}"
|
||||
networkPhotoRoot="/home/network/Qbilder/photos/${subDir}"
|
||||
thumbRoot="${piwiThumbRoot}/${subDir}"
|
||||
photoRoot="${piwiPhotoRoot}/${subDir}"
|
||||
|
||||
if [ ! -e ${networkPhotoRoot} ]
|
||||
then
|
||||
echo "${networkPhotoRoot} not found"
|
||||
if [ ! -e ${thumbRoot} ] ; then
|
||||
echo "Thumbnail root ${thumbRoot} not found"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
/root/script/piwigo_thumbgen.sh "${networkPhotoRoot}" "${piwigoThumbRoot}"
|
||||
if [ ! -e ${photoRoot} ] ; then
|
||||
echo "Photo root ${photoRoot} not found"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
/root/script/piwirefresh.sh
|
||||
$WDIR/piwigo_thumbgen.sh "${photoRoot}" "${thumbRoot}"
|
||||
|
||||
$WDIR/piwirefresh.sh
|
||||
|
Reference in New Issue
Block a user