summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow (mars.fritz.box) <paul@buetow.org>2014-01-03 23:14:18 +0100
committerPaul Buetow (mars.fritz.box) <paul@buetow.org>2014-01-03 23:14:18 +0100
commitab18c57f6b45b1be567e8e1d8224c372ed116dba (patch)
tree584f0b8723315e29f1fcbf6ba833f7db85396951
parenta9758bb1b1ac3dd53af96180448f5d98fda3d9e8 (diff)
While you recently had your problems on the run, they've regrouped and0.2.0
are making another attack.
-rw-r--r--src/photoalbum.default.conf2
-rwxr-xr-xsrc/photoalbum.sh17
2 files changed, 9 insertions, 10 deletions
diff --git a/src/photoalbum.default.conf b/src/photoalbum.default.conf
index 3e8cf10..6284988 100644
--- a/src/photoalbum.default.conf
+++ b/src/photoalbum.default.conf
@@ -13,8 +13,6 @@ TEMPLATE_DIR=/usr/share/photoalbum/templates
# Includes a .tar of the incoming dir in the dist, can be yes or no
declare -r TARBALL_INCLUDE=yes
-
-# If INCLUDETARBALL=yes, set the Name of the tarball
declare -r TARBALL_SUFFIX=.tar
declare -r TAR_OPTS='-c'
diff --git a/src/photoalbum.sh b/src/photoalbum.sh
index c89dd50..85a1cab 100755
--- a/src/photoalbum.sh
+++ b/src/photoalbum.sh
@@ -17,13 +17,6 @@ init () {
for dir in "${INCOMING_DIR}" "${DIST_DIR}/photos" "${DIST_DIR}/thumbs" "${DIST_DIR}/html"; do
[ -d "${dir}" ] || mkdir -vp "${dir}"
done
-
- if [ "${TARBALL_INCLUDE}" = yes ]; then
- local -r BASE=$(basename "${INCOMING_DIR}")
- local -r NOW=$(date +'%Y-%m-%d-%H%M%S')
- # New global variable
- TARBALL_NAME="${BASE}-${NOW}.${TARBALL_SUFFIX}"
- fi
}
clean () {
@@ -55,6 +48,13 @@ generate () {
exit 1
fi
+ if [ "${TARBALL_INCLUDE}" = yes ]; then
+ local -r BASE=$(basename "${INCOMING_DIR}")
+ local -r NOW=$(date +'%Y-%m-%d-%H%M%S')
+ # New global variable
+ TARBALL_NAME="${BASE}-${NOW}.${TARBALL_SUFFIX}"
+ fi
+
scale
find "${DIST_DIR}/html" -type f -name \*.html -delete
makedist 1
@@ -71,8 +71,9 @@ template () {
scale () {
cd "${INCOMING_DIR}" && find ./ -type f | sort | while read photo; do
- if [ ! -f "${DIST_DIR}/photos/${photo}" ]; then
+ photo=$(sed 's#^\./##' <<< "${photo}")
+ if [ ! -f "${DIST_DIR}/photos/${photo}" ]; then
# Flatten directories / to __
if [[ "${photo}" =~ / ]]; then
destphoto="${photo//\//__}"