diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-10-17 22:20:46 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-10-17 22:20:46 +0200 |
commit | 993c9a7807e38b365f48334fff6640e07647af03 (patch) | |
tree | 4347844f2039b29f134e4f729ce38180ad047f8c /.app/lib/app-conf | |
parent | fbc6c0b93a88ac10730dd6f4492750cd32e2b44a (diff) | |
download | app.sh-993c9a7807e38b365f48334fff6640e07647af03.tar.gz app.sh-993c9a7807e38b365f48334fff6640e07647af03.tar.bz2 app.sh-993c9a7807e38b365f48334fff6640e07647af03.tar.xz app.sh-993c9a7807e38b365f48334fff6640e07647af03.zip |
o Renaming BASEDIR to apps, APPSH_BASEDIR to APPSH_APPS.
Diffstat (limited to '.app/lib/app-conf')
-rw-r--r-- | .app/lib/app-conf | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/.app/lib/app-conf b/.app/lib/app-conf index c9204e9..4cf4b7f 100644 --- a/.app/lib/app-conf +++ b/.app/lib/app-conf @@ -15,12 +15,12 @@ format_conf() { } get_conf() { - local BASEDIR=$1 + local apps=$1 local name=$2 local instance=$3 local key=$4 local default= - local file=$BASEDIR/$name/$instance/current/etc/app.conf + local file=$apps/$name/$instance/current/etc/app.conf shift 4 @@ -47,10 +47,10 @@ get_conf() { } get_conf_all() { - local BASEDIR=$1 + local apps=$1 local name=$2 local instance=$3 - local file=$BASEDIR/$name/$instance/current/etc/app.conf + local file=$apps/$name/$instance/current/etc/app.conf if [ ! -r "$file" ] then @@ -61,12 +61,12 @@ get_conf_all() { } get_conf_in_group() { - local BASEDIR=$1 + local apps=$1 local name=$2 local instance=$3 local group=$4 - get_conf_all "$BASEDIR" "$name" "$instance" | sed -n "s,^${group}\.\(.*\),\1,p" + get_conf_all "$apps" "$name" "$instance" | sed -n "s,^${group}\.\(.*\),\1,p" } assert_key() { @@ -81,13 +81,13 @@ assert_key() { } conf_set() { - local BASEDIR=$1 + local apps=$1 local name=$2 local instance=$3 local key=$4 local value=$5 - local file=$BASEDIR/$name/$instance/current/etc/app.conf + local file=$apps/$name/$instance/current/etc/app.conf assert_key "$key" @@ -101,12 +101,12 @@ conf_set() { } conf_delete() { - local BASEDIR=$1 + local apps=$1 local name=$2 local instance=$3 local key=$4 - local file=$BASEDIR/$name/$instance/current/etc/app.conf + local file=$apps/$name/$instance/current/etc/app.conf assert_key "$key" @@ -118,7 +118,7 @@ method_conf_list() { local name=$1; shift local instance=$1; shift - get_conf_all "$BASEDIR" "$name" "$instance" | format_conf + get_conf_all "$apps" "$name" "$instance" | format_conf } method_conf_usage() { @@ -166,7 +166,7 @@ method_conf() { exit 1 fi - get_conf_in_group "$BASEDIR" "$name" "$instance" "$1" | format_conf + get_conf_in_group "$apps" "$name" "$instance" "$1" | format_conf ;; set) if [ $# -ne 2 ] @@ -175,7 +175,7 @@ method_conf() { exit 1 fi - conf_set "$BASEDIR" "$name" "$instance" "$1" "$2" + conf_set "$apps" "$name" "$instance" "$1" "$2" ;; delete) if [ $# -ne 1 ] @@ -184,7 +184,7 @@ method_conf() { exit 1 fi - conf_delete "$BASEDIR" "$name" "$instance" "$1" + conf_delete "$apps" "$name" "$instance" "$1" ;; *) if [ $# -eq 0 ] |