summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Buetow (mars.fritz.box) <paul@buetow.org>2014-02-16 12:29:01 +0100
committerPaul Buetow (mars.fritz.box) <paul@buetow.org>2014-02-16 12:29:01 +0100
commitac808ecf232e1985d1fb2121691f23f94c5f2ecf (patch)
treef5ba4667bc2dff0fe1c5ad3731294a1e88c99b4b /src
parenta0f45c9e97570bea83001c8106b5847723e8a863 (diff)
add optional custom rcfile path
Diffstat (limited to 'src')
-rwxr-xr-xsrc/photoalbum.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/photoalbum.sh b/src/photoalbum.sh
index 38117a0..174fe8c 100755
--- a/src/photoalbum.sh
+++ b/src/photoalbum.sh
@@ -3,14 +3,20 @@
# photoalbum (c) 2011 - 2014 by Paul Buetow
# http://photoalbum.buetow.org
-declare -r ARG1="${1}" ; shift
+declare -r ARG1="${1}"; shift
+declare RC="${1}" ; shift
+
declare -r VERSION='PHOTOALBUMVERSION'
declare -r DEFAULTRC=/etc/default/photoalbum
+if [ -z "${RC}" ]; then
+ RCFILE="${DEFAULTRC}"
+fi
+
usage() {
cat - <<USAGE >&2
Usage:
- $0 [clean|init|version|generate|all]
+ $0 clean|init|version|generate|all [rcfile]
USAGE
}
@@ -165,7 +171,7 @@ makedist() {
done
}
-source "${DEFAULTRC}"
+source "${RC}"
if [ -f ~/.photoalbumrc ]; then
source ~/.photoalbumrc