summaryrefslogtreecommitdiff
path: root/zshfunc
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2009-05-08 19:18:47 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2009-05-08 19:18:47 +0000
commit0af45db40a809524fe0b3f7f38d5185717ff8758 (patch)
tree3cc9372cf7611cb79f08d075d30a645174c04c4b /zshfunc
parent8ab42a34318201ecb67d96dac5e688ccf4cc7f34 (diff)
remove function headers
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@392 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'zshfunc')
-rw-r--r--zshfunc/fpr10
-rw-r--r--zshfunc/md6
-rw-r--r--zshfunc/reinit-debian-samhain10
-rw-r--r--zshfunc/reinit-debian-samhain-one58
-rw-r--r--zshfunc/sd10
-rw-r--r--zshfunc/upgrade-debian-hosts24
-rw-r--r--zshfunc/upgrade-debian-samhain86
-rw-r--r--zshfunc/upgrade-porter-chroots16
-rw-r--r--zshfunc/upgrade-systems28
9 files changed, 115 insertions, 133 deletions
diff --git a/zshfunc/fpr b/zshfunc/fpr
index 1d53d03..38afc3b 100644
--- a/zshfunc/fpr
+++ b/zshfunc/fpr
@@ -1,8 +1,6 @@
## vim:ft=zsh:foldmethod=marker
-fpr() {
- (
- ssh-keygen -r '' -f =( ssh-keyscan -t rsa $1 2>/dev/null | sed -e 's/^[^ ]* //');
- ssh-keygen -r '' -f =( ssh-keyscan -t dsa $1 2>/dev/null | sed -e 's/^[^ ]* //');
- ) | sed -e 's/^[^ ]* //'
-}
+(
+ ssh-keygen -r '' -f =( ssh-keyscan -t rsa $1 2>/dev/null | sed -e 's/^[^ ]* //');
+ ssh-keygen -r '' -f =( ssh-keyscan -t dsa $1 2>/dev/null | sed -e 's/^[^ ]* //');
+) | sed -e 's/^[^ ]* //'
diff --git a/zshfunc/md b/zshfunc/md
index 1055e77..d14a2b6 100644
--- a/zshfunc/md
+++ b/zshfunc/md
@@ -1,6 +1,4 @@
## vim:ft=zsh:foldmethod=marker
-md() {
- DIR="$1"
- mkdir "$1" && cd "$1"
-}
+DIR="$1"
+mkdir "$1" && cd "$1"
diff --git a/zshfunc/reinit-debian-samhain b/zshfunc/reinit-debian-samhain
index 9880a1e..5448eaf 100644
--- a/zshfunc/reinit-debian-samhain
+++ b/zshfunc/reinit-debian-samhain
@@ -1,8 +1,6 @@
## vim:ft=zsh:foldmethod=marker
-reinit-debian-samhain() {
- for i in $DEBHOSTS; do
- mkdir hosts/$i 2> /dev/null || continue;
- reinit-debian-samhain-one $i
- done
-}
+for i in $DEBHOSTS; do
+ mkdir hosts/$i 2> /dev/null || continue;
+ reinit-debian-samhain-one $i
+done
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
+';
diff --git a/zshfunc/sd b/zshfunc/sd
index 8805b6f..9550e63 100644
--- a/zshfunc/sd
+++ b/zshfunc/sd
@@ -1,8 +1,6 @@
## vim:ft=zsh:foldmethod=marker
-sd() {
- fp=$( wget -q -O - http://tor.noreply.org:80/tor/status/authority | \
- awk '$1 == "r" && $2 == "'$1'" {printf "%s===", $3}' | \
- perl -MMIME::Base64 -e "print unpack(\"H*\", decode_base64(<>)),\"\n\"" )
- echo wget -q -O - http://tor.noreply.org:80/tor/server/fp/$fp
-}
+fp=$( wget -q -O - http://tor.noreply.org:80/tor/status/authority | \
+ awk '$1 == "r" && $2 == "'$1'" {printf "%s===", $3}' | \
+ perl -MMIME::Base64 -e "print unpack(\"H*\", decode_base64(<>)),\"\n\"" )
+echo wget -q -O - http://tor.noreply.org:80/tor/server/fp/$fp
diff --git a/zshfunc/upgrade-debian-hosts b/zshfunc/upgrade-debian-hosts
index b288b53..5e44588 100644
--- a/zshfunc/upgrade-debian-hosts
+++ b/zshfunc/upgrade-debian-hosts
@@ -1,15 +1,13 @@
## vim:ft=zsh:foldmethod=marker
-upgrade-debian-hosts() {
- cd
- for i in $DEBHOSTS; do
- mkdir hosts/$i 2>/dev/null || continue;
- echo $i;
- preexec $i;
- ssh $i -t '
- sudo apt-get update &&
- sudo apt-get dist-upgrade &&
- sudo apt-get clean
- ';
- done
-}
+cd
+for i in $DEBHOSTS; do
+ mkdir hosts/$i 2>/dev/null || continue;
+ echo $i;
+ preexec $i;
+ ssh $i -t '
+ sudo apt-get update &&
+ sudo apt-get dist-upgrade &&
+ sudo apt-get clean
+ ';
+done
diff --git a/zshfunc/upgrade-debian-samhain b/zshfunc/upgrade-debian-samhain
index be5dc7b..6267567 100644
--- a/zshfunc/upgrade-debian-samhain
+++ b/zshfunc/upgrade-debian-samhain
@@ -1,48 +1,46 @@
## vim:ft=zsh:foldmethod=marker
-upgrade-debian-samhain() {
- for i in $DEBHOSTS; do
- mkdir hosts/$i 2> /dev/null || continue;
- echo $i
- preexec $i;
- ssh $i -t '
- didsudo=0
- check() {
- sudo /usr/sbin/samhain -t check -i -p err -s none -l none -m none
- };
- reinit() {
- if [ "`check 2>&1 | grep "^CRIT" | wc -l`" != 0 ]; then
- echo Updating samhain db...
- sudo samhain --foreground -t update
- didsudo=1
- echo done.
- fi
- }
- 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;
- fi;
- fi
- sudo apt-get update &&
- sudo apt-get dist-upgrade &&
- sudo apt-get clean &&
- [ -x /usr/sbin/samhain ] && reinit
- if [ "$didsudo" = 1 ]; then
- echo Updating nagios status
- echo "apt"
- sudo /usr/sbin/dsa-update-apt-status
- echo "samhain"
- grep -q OK /var/cache/dsa/nagios/samhain || sudo dsa-update-samhain-status
+for i in $DEBHOSTS; do
+ mkdir hosts/$i 2> /dev/null || continue;
+ echo $i
+ preexec $i;
+ ssh $i -t '
+ didsudo=0
+ check() {
+ sudo /usr/sbin/samhain -t check -i -p err -s none -l none -m none
+ };
+ reinit() {
+ if [ "`check 2>&1 | grep "^CRIT" | wc -l`" != 0 ]; then
+ echo Updating samhain db...
+ sudo samhain --foreground -t update
+ didsudo=1
echo done.
fi
- ';
- done
-}
+ }
+ 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;
+ fi;
+ fi
+ sudo apt-get update &&
+ sudo apt-get dist-upgrade &&
+ sudo apt-get clean &&
+ [ -x /usr/sbin/samhain ] && reinit
+ if [ "$didsudo" = 1 ]; then
+ echo Updating nagios status
+ echo "apt"
+ sudo /usr/sbin/dsa-update-apt-status
+ echo "samhain"
+ grep -q OK /var/cache/dsa/nagios/samhain || sudo dsa-update-samhain-status
+ echo done.
+ fi
+ ';
+done
diff --git a/zshfunc/upgrade-porter-chroots b/zshfunc/upgrade-porter-chroots
index 7f22060..38801e5 100644
--- a/zshfunc/upgrade-porter-chroots
+++ b/zshfunc/upgrade-porter-chroots
@@ -1,11 +1,9 @@
## vim:ft=zsh:foldmethod=marker
-upgrade-porter-chroots() {
- cd
- for i in $DEBPORTERHOSTS; do
- mkdir hosts/chroot-$i 2>/dev/null || continue;
- echo $i;
- preexec $i;
- ssh $i -t 'sudo /usr/sbin/upgrade-porter-chroots'
- done
-}
+cd
+for i in $DEBPORTERHOSTS; do
+ mkdir hosts/chroot-$i 2>/dev/null || continue;
+ echo $i;
+ preexec $i;
+ ssh $i -t 'sudo /usr/sbin/upgrade-porter-chroots'
+done
diff --git a/zshfunc/upgrade-systems b/zshfunc/upgrade-systems
index 071c8dc..a88a356 100644
--- a/zshfunc/upgrade-systems
+++ b/zshfunc/upgrade-systems
@@ -1,17 +1,15 @@
## vim:ft=zsh:foldmethod=marker
-upgrade-systems() {
- cd
- for i in $HOSTS; do
- mkdir hosts/$i 2>/dev/null || continue;
- echo $i;
- preexec $i;
- ssh $i -t 'apt-get update &&
- if [ -e /usr/bin/apt-get.distrib ]; then
- aptitude dist-upgrade;
- else
- apt-get dist-upgrade;
- fi &&
- apt-get clean';
- done
-}
+cd
+for i in $HOSTS; do
+ mkdir hosts/$i 2>/dev/null || continue;
+ echo $i;
+ preexec $i;
+ ssh $i -t 'apt-get update &&
+ if [ -e /usr/bin/apt-get.distrib ]; then
+ aptitude dist-upgrade;
+ else
+ apt-get dist-upgrade;
+ fi &&
+ apt-get clean';
+done