Skip to content
Snippets Groups Projects
Commit 890f3607 authored by JonOfUs's avatar JonOfUs
Browse files

Make compatible with buero-pc

parent dd11f71c
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,10 @@ if [ -z "$UNIHOST" ]; then
read -p "Host: " UNIHOST
fi
if [ -z "$UNIUSER2" ]; then
UNIUSER2="$UNIUSER"
fi
if [ -z "$UNIHOST2" ]; then
UNIHOST2="$UNIHOST"
fi
......@@ -72,11 +76,11 @@ if [ -z "$ORIENTATION" ]; then
fi
if [ -z "$DUPLEX" ]; then
DUPLEX=simplex
DUPLEX=one-sided
fi
if [ -z "$PAGES" ]; then
PAGES=0
PAGES=1
fi
if [ -z "$RANGE" ]; then
......@@ -107,7 +111,33 @@ case $QUALITY in
;;
esac
ADDITIONALOPTIONS="-#$COUNT -K$DUPLEX -O$ORIENTATION -onumber-up=$PAGES -opage-ranges=$RANGE -oprint-quality=$QUALITY"
case $ORIENTATION in
portrait)
ORIENTATION=""
;;
landscape)
ORIENTATION="-oorientation-requested=4"
;;
*)
echo "Unknown orientation $ORIENTATION"
exit 1
;;
esac
case $PAGES in
0 | 1)
PAGES=""
;;
2 | 4 | 6 | 9 | 16)
PAGES="-onumber-up=$PAGES"
;;
*)
echo "Invalid number of pages per output page, $PAGES"
exit 1
;;
esac
ADDITIONALOPTIONS="-#$COUNT $ORIENTATION $PAGES -osides=$DUPLEX -opage-ranges=$RANGE -oprint-quality=$QUALITY"
FILE=$@
if [ -z "$FILE" ]; then
......@@ -117,9 +147,15 @@ fi
echo "Printing $FILE on $UNIPRINTER as $UNIUSER@$UNIHOST"
# If the host is localhost, we can print directly
if [ "$UNIHOST" -eq "localhost" ]; then
if [ "$UNIHOST" = "localhost" ]; then
lpr -P $UNIPRINTER $UNIOPTIONS $ADDITIONALOPTIONS "$FILE"
exit $?
fi
ssh -J "$UNIUSER@$UNIHOST" $UNIUSER@$UNIHOST2 "lpr -P $UNIPRINTER $UNIOPTIONS $ADDITIONALOPTIONS" < "$FILE"
if [ "$UNIHOST2" = "$UNIHOST" ]; then
JUMPHOST=""
else
JUMPHOST="-J $UNIUSER@$UNIHOST"
fi
ssh $JUMPHOST $UNIUSER2@$UNIHOST2 "lpr -P $UNIPRINTER $UNIOPTIONS $ADDITIONALOPTIONS" <"$FILE"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment