File: roger-cups

package info (click to toggle)
roger-router 1.8.14-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,256 kB
  • sloc: ansic: 24,958; sh: 4,322; makefile: 702; xml: 511; cpp: 130
file content (21 lines) | stat: -rwxr-xr-x 477 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

if [ $# -eq 0 ] ; then
	# Device Discovery
	echo "file roger-cups:/ \"Unknown\" \"Tabos.org Roger Router Fax Printer\""
	exit 0 # CUPS_BACKEND_OK
fi

RNAME="$2-Fax-ID$1"
SPOOL_DIR="/var/spool/roger"

if [ $# -eq 6 ]; then
	cp "$6" "$SPOOL_DIR/$RNAME.tmp" || exit 1 # CUPS_BACKEND_FAILED
else
	cat > "$SPOOL_DIR/$RNAME.tmp" || exit 1 # CUPS_BACKEND_FAILED
fi

chmod 660 "$SPOOL_DIR/$RNAME.tmp"
mv "$SPOOL_DIR/$RNAME.tmp" "$SPOOL_DIR/$RNAME"

exit 0 # CUPS_BACKEND_OK