diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2006-08-24 06:26:15 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2006-08-24 06:26:15 +0000 |
commit | 0b250374c58d453fc406ea0640763863c1e279f2 (patch) | |
tree | 3716d041b27d30f8a5fecdf729d3635e2a98bbc1 | |
parent | e23808a00ce9ac392291379c8ed3795f0f0402bf (diff) | |
download | sitesummary-0b250374c58d453fc406ea0640763863c1e279f2.tar.gz sitesummary-0b250374c58d453fc406ea0640763863c1e279f2.tar.bz2 sitesummary-0b250374c58d453fc406ea0640763863c1e279f2.tar.xz |
Improve configuration handling.
-rw-r--r-- | sitesummary-client | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/sitesummary-client b/sitesummary-client index c897af6..f75461a 100644 --- a/sitesummary-client +++ b/sitesummary-client @@ -8,25 +8,35 @@ set -e serverurl=http://localhost/cgi-bin/sitesummary-collector.cgi -fragments=/usr/lib/sitesummary/collect.d/ - -for conf in \ - /usr/share/sitesummary/config \ - /usr/share/sitesummary/config-site \ - /etc/sitesummary.conf ; do - . $conf -done +fragdirs="/usr/lib/sitesummary/collect.d \ + /etc/sitesummary/collect.d" +# Make sure to store files in a ramfs backed +# storage area on diskless clients, so use /tmp/. tmpdir=/tmp/sitesummary-$$ +# Read the package default +[ -f /usr/share/sitesummary/config ] && . /usr/share/sitesummary/config +for confdir in \ + /usr/share/sitesummary/config.d \ + /etc/sitesummary/config.d +do + [ -d $confdir ] || continue + for config in $confdir/* ; do + [ -f $conf ] && . $conf + done +done + mkdir $tmpdir && cd $tmpdir -for frag in $fragments/*; do - $frag +for fragdir in $fragdirs ; do + [ -d $fragdir ] || continue + for frag in $fragdir/*; do + [ -x $frag ] && $frag + done done tar zcf $tmpdir.tar.gz . -wget --no-check-certificate --post-file $tmpdir.tar.gz $serverurl - -# wget --no-check-certificate -O /tmp/lts.conf $MY_CONFIG_SERVER\?mac=$MY_NODE_MAC/ip=$MY_NODE_IP/bootservip=$MY_NFSROOT_IP/code=1 --post-file=/tmp/post_inventory.txt 1>&2 +#WGETOPTS="--no-check-certificate" +wget $WGETOPTS --post-file $tmpdir.tar.gz -O $tmpdir.result $serverurl |