Added {r,}btadd.
[utils.git] / rbtadd
diff --git a/rbtadd b/rbtadd
new file mode 100755 (executable)
index 0000000..3dad05a
--- /dev/null
+++ b/rbtadd
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+if [ $# -lt 1 ]; then
+    echo "usage: btadd URL..." >&2
+    exit 1
+fi
+
+for file in "$@"; do
+    if [ -r "$file" ]; then
+       rsc pc17 btadd -o - <"$file" && rm -f "$file"
+    elif [[ "$file" == http*://* ]]; then
+       rsc pc17 btadd -o "$file"
+    else
+       echo "rbtadd: $file: unreadable" >&2
+    fi
+done