| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# Script to start LPrint as a server. |
| 4 |
# |
| 5 |
# Copyright © 2022 by Michael R Sweet |
| 6 |
# |
| 7 |
# Licensed under Apache License v2.0. See the file "LICENSE" for more |
| 8 |
# information. |
| 9 |
# |
| 10 |
|
| 11 |
# Collect options: |
| 12 |
# |
| 13 |
# - admin-group: The name of the administrative group to use |
| 14 |
# - auth-service: The PAM authentication service to use |
| 15 |
# - listen-hostname: Listen hostname ("*" for all addresses) |
| 16 |
# - log-file: Log filename ("-" for stderr, "syslog" for system log) |
| 17 |
# - log-level: Log level (fatal, error, warn, info, debug) |
| 18 |
# - server-hostname: Host name to use |
| 19 |
# - server-name: DNS-SD name for LPrint on this system |
| 20 |
# - server-options: Comma-separated list of server options (none, dnssd-host, |
| 21 |
# no-multi-queue, raw-socket, usb-printer, no-web-interface, web-log, |
| 22 |
# web-network, web-remote, web-security, no-tls) |
| 23 |
# - server-port: Port number to use |
| 24 |
# - spool-directory: The directory for spool and state files |
| 25 |
# |
| 26 |
|
| 27 |
options="" |
| 28 |
for option in admin-group auth-service listen-hostname log-file log-level server-options spool-directory server-hostname server-name server-port; do |
| 29 |
value="$(snapctl get $option)" |
| 30 |
if test "x$value" != x; then |
| 31 |
options="$options $option='$value'" |
| 32 |
fi |
| 33 |
done |
| 34 |
|
| 35 |
# Execute the server with the specified options... |
| 36 |
exec lprint server -o "$options" |