diff options
author | root <root@mail.bitbase.dk> | 2008-12-15 14:28:00 +0100 |
---|---|---|
committer | root <root@mail.bitbase.dk> | 2008-12-15 14:28:00 +0100 |
commit | 12ed4eed5aaa1774e2edac4eb7f58bf979a1a4b1 (patch) | |
tree | 104ffe3e236e7e24379418ab210e858841188d62 /localwebgallerydaemon | |
parent | 38726003bfe2684a99f5a789107c6558e67e1407 (diff) |
Implement --theme option in localwebgallerydaemon.
Diffstat (limited to 'localwebgallerydaemon')
-rwxr-xr-x | localwebgallerydaemon | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/localwebgallerydaemon b/localwebgallerydaemon index b1d1c28..17d61f2 100755 --- a/localwebgallerydaemon +++ b/localwebgallerydaemon @@ -25,7 +25,7 @@ set -e SOURCEDIR="$HOME/public_media" TARGETDIR="$HOME/public_html/gallery" GENERATOR="lazygal" -THEME="image-index" +THEME="" PRG=$(basename "$0") @@ -35,6 +35,7 @@ Usage: $PRG [ SOURCEDIR [ TARGETDIR ] ] Options: -g, --generator Gallery generator to use (default: $GENERATOR) + -t, --theme Gallery theme to use (default: ${THEME:-no theme}) -w, --watch Watch source, updating each time something changes -n, --now Update once -v, --verbose Print activities to stderr while running @@ -61,7 +62,7 @@ exit1() { exit 1 } -TEMP="`getopt -s sh -o g:wnvh -l generator:,watch,now,verbose,help -n "$PRG" -- "$@"`" +TEMP="`getopt -s sh -o g:t:wnvh -l generator:,theme:,,watch,now,verbose,help -n "$PRG" -- "$@"`" if [ $? != 0 ] ; then exit1 " Internal getopt error."; fi eval set -- "$TEMP" @@ -71,6 +72,7 @@ verbose= while true ; do case "$1" in -g|--generator) generator="$2"; shift 2;; + -t|--theme) theme="$2"; shift 2;; -w|--watch) watch="yes"; shift;; -n|--now) now="yes"; shift;; -v|--verbose) verbose="yes"; shift;; @@ -82,6 +84,7 @@ done # Use defaults if not overridden generator="${generator:-$GENERATOR}" +theme="${theme:-$THEME}" sourcedir="${1:-$SOURCEDIR}" targetdir="${2:-$TARGETDIR}" @@ -110,8 +113,7 @@ case $generator in esac # Static defaults -lazygal_opts="--quiet --check-all-dirs --clean-destination" -lazygal_theme_opts="${THEME:+--theme $THEME}" +lazygal_opts="--quiet --check-all-dirs --clean-destination ${THEME:+--theme $THEME}" # Sanity checks [ -d "$sourcedir" ] || exit1 "Source directory \"$sourcedir\" is not a directory" @@ -130,7 +132,7 @@ updategallery() { case "$generator" in lazygal) mispipe \ - "lazygal $lazygal_opts $lazygal_theme_opts -o \"$targetdir\" \"$sourcedir\" 2>&1" \ + "lazygal $lazygal_opts -o \"$targetdir\" \"$sourcedir\" 2>&1" \ "egrep -v '^(Error: Directory Makernote with 5376 entries considered invalid; not read.|Warning: Failed to read Makernote, rc = 6)$'" \ || onemoretime=yes ;; |