From d42666c579af9b97c32f00c7f425cd0ea007f719 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Fri, 4 Nov 2016 10:30:11 +0100 Subject: [PATCH] add print script --- local/bin/print | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 local/bin/print diff --git a/local/bin/print b/local/bin/print new file mode 100644 index 0000000..35697f5 --- /dev/null +++ b/local/bin/print @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "usage: $0 [--colour] " + echo + echo " -c | --colour print in colour" + echo " file file (print-ready) to print or -" + echo + echo "print print-ready files with the UGent printers. Accepts only" + echo ".txt, .ps, .pdf, .pcl, .cht and .prn." + exit 1 +fi >&2 + +if [ "$1" == "-c" -o "$1" == "--colour" ]; then + curl --insecure -F "fileToPrint=@$2" 'https://we02pr06.ugent.be/hp/device/Print/Print' +else + curl --insecure -F "localFile=@$1" 'https://we02pr04.ugent.be/hp/device/this.printservice?printThis' +fi