From: Anders Kaseorg Date: Sun, 21 Mar 2010 00:56:11 +0000 (-0400) Subject: apt-zephyr: Make send_zephyr a function. X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/.git/commitdiff_plain/2cca0470955143de63836df1902fa31090cdb771 apt-zephyr: Make send_zephyr a function. Signed-off-by: Anders Kaseorg --- diff --git a/apt-zephyr/apt-zephyr b/apt-zephyr/apt-zephyr index 54300bd..a8e50df 100755 --- a/apt-zephyr/apt-zephyr +++ b/apt-zephyr/apt-zephyr @@ -13,6 +13,18 @@ ZAUTH= # Read configuration . /etc/apt-zephyr.conf +send_zephyr () +{ + zwrite \ + ${CLASS:+-c "$CLASS"} \ + ${INSTANCE:+-i "$INSTANCE"} \ + ${REALM:+-r "$REALM"} \ + ${SIG:+-s "$SIG"} \ + ${OPCODE:+-O "$OPCODE"} \ + ${ZAUTH:--d} \ + ${RECIPIENTS:+$RECIPIENTS} +} + package () { package=$1 @@ -75,5 +87,4 @@ case "$line" in done rm -f "$oldpkgs" "$newpkgs" ;; -esac | \ - zwrite ${CLASS:+-c "$CLASS"} ${INSTANCE:+-i "$INSTANCE"} ${REALM:+-r "$REALM"} ${SIG:+-s "$SIG"} ${OPCODE:+-O "$OPCODE"} ${ZAUTH:--d} ${RECIPIENTS:+$RECIPIENTS} +esac | send_zephyr