From 0af45db40a809524fe0b3f7f38d5185717ff8758 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 8 May 2009 19:18:47 +0000 Subject: remove function headers git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@392 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- zshfunc/reinit-debian-samhain-one | 58 +++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'zshfunc/reinit-debian-samhain-one') diff --git a/zshfunc/reinit-debian-samhain-one b/zshfunc/reinit-debian-samhain-one index c4490bb..fd9d3c6 100644 --- a/zshfunc/reinit-debian-samhain-one +++ b/zshfunc/reinit-debian-samhain-one @@ -1,33 +1,31 @@ ## vim:ft=zsh:foldmethod=marker -reinit-debian-samhain-one() { - host=$1 - if [ "$host" = "${host%%.debian.org}" ]; then - host="$host.debian.org" - fi - echo $host - preexec $host; - ssh $host -t ' - check() { - sudo /usr/sbin/samhain -t check -i -p err -s none -l none -m none - }; - if [ -x /usr/sbin/samhain ]; then - t="`tempfile`"; - trap "rm -f $t" 0 1 2 5 15; - check > "$t" 2>&1; - if [ "`grep "^CRIT" "$t" | wc -l`" != 0 ]; then - echo "samhain db errors found:"; - sed -e "s/.*path=<\([^>]*\)>, .*/\1/" "$t"; - echo; - echo "Enter 'y' to continue upgrade and update samhaindb for `hostname`"; - read ans; - [ "$ans" = "y" ] || exit; +host=$1 +if [ "$host" = "${host%%.debian.org}" ]; then + host="$host.debian.org" +fi +echo $host +preexec $host; +ssh $host -t ' + check() { + sudo /usr/sbin/samhain -t check -i -p err -s none -l none -m none + }; + if [ -x /usr/sbin/samhain ]; then + t="`tempfile`"; + trap "rm -f $t" 0 1 2 5 15; + check > "$t" 2>&1; + if [ "`grep "^CRIT" "$t" | wc -l`" != 0 ]; then + echo "samhain db errors found:"; + sed -e "s/.*path=<\([^>]*\)>, .*/\1/" "$t"; + echo; + echo "Enter 'y' to continue upgrade and update samhaindb for `hostname`"; + read ans; + [ "$ans" = "y" ] || exit; - echo Updating samhain db... - sudo samhain --foreground -t update - grep -q OK /var/cache/dsa/nagios/samhain || sudo dsa-update-samhain-status - echo done. - fi; - fi - '; -} + echo Updating samhain db... + sudo samhain --foreground -t update + grep -q OK /var/cache/dsa/nagios/samhain || sudo dsa-update-samhain-status + echo done. + fi; + fi +'; -- cgit v1.2.3