diff options
-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 |