aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-04-01 13:42:57 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-04-01 13:42:57 -0300
commitd143a87c11c37f29a788cfd069bb8377f3203c04 (patch)
tree2c19c13fe2d38bf62db560968346c601fb40e085
parentee111b0a940badb559ec918209e2f17b6f4b14ad (diff)
downloadscripts-d143a87c11c37f29a788cfd069bb8377f3203c04.tar.gz
scripts-d143a87c11c37f29a788cfd069bb8377f3203c04.tar.bz2
Adds lpr-ssh
-rwxr-xr-xlpr-ssh23
1 files changed, 23 insertions, 0 deletions
diff --git a/lpr-ssh b/lpr-ssh
new file mode 100755
index 0000000..cf7db82
--- /dev/null
+++ b/lpr-ssh
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# LPR over SSH.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+SERVER="$1"
+
+# Shift
+shift
+
+# Check
+if [ -z "$1" ]; then
+ echo "usage: $BASENAME <server> <file>"
+ exit 1
+elif [ ! -e "$*" ]; then
+ echo "no such file: $*"
+ exit 1
+fi
+
+# Proceed
+cat "$*" | ssh $SERVER lpr