dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

geoprint (676B)


      1 #!/bin/sh
      2 # requirements: samba
      3 
      4 die() {
      5 	printf '%s: error: %s\n' "${0##*/}" "$1" >&2
      6 	exit 1
      7 }
      8 
      9 usage() {
     10 	printf 'usage: %s [-h] file ...\n' "${0##*/}"
     11 }
     12 
     13 while :; do
     14 	case "$1" in
     15 		-h)
     16 			usage
     17 			exit 0;;
     18 		--) # end all options
     19 			shift
     20 			break;;
     21 		-?*)
     22 			die "unknown option specified: $1";;
     23 		*)  # No more options
     24 			break
     25 	esac
     26 	shift
     27 done
     28 
     29 if [ $# -lt 1 ]; then
     30 	usage
     31 	exit 1
     32 fi
     33 
     34 pass="$(pass Uni/mit.au.dk-217756)"
     35 for f in "$@"; do
     36 	if [ "${f##*.}" = "pdf" ]; then
     37 		out="$(mktemp).pdf"
     38 		pdfjam --outfile "$out" --paper a4paper "$f"
     39 	else
     40 		out="$f"
     41 	fi
     42 	smbclient //prt11.uni.au.dk/1672-129-C-2 \
     43 		-U "au217756%${pass}" -W uni \
     44 		-c "print \"$out\""
     45 done