]> sipb.mit.edu Git - snippets/.git/blobdiff - apt-zephyr/apt-zephyr
apt-zephyr: Make send_zephyr a function.
[snippets/.git] / apt-zephyr / apt-zephyr
index 54300bdb5f6cd89b293dc5ad58be332b8f78645d..a8e50dfcf8e5a526e9aa871e44ce463097c85484 100755 (executable)
@@ -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