print/cloud-print-connector: Add service/daemon script
PR: 235308 Submitted by: Robert James Hernandez <rob@sarcasticadmin.com> (modified slightly)
This commit is contained in:
parent
436f1fdfe5
commit
41b11d7c99
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=491799
@ -2,6 +2,7 @@
|
||||
|
||||
PORTNAME= cloud-print-connector
|
||||
PORTVERSION= 1.16
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= print
|
||||
|
||||
MAINTAINER= swills@FreeBSD.org
|
||||
@ -18,6 +19,7 @@ LIB_DEPENDS= libcups.so:print/cups \
|
||||
|
||||
USES= compiler pkgconfig
|
||||
USE_GITHUB= yes
|
||||
USE_RC_SUBR= gcp-cups-connectord
|
||||
GH_TUPLE= google:cloud-print-connector:7d5f127:DEFAULT/src/github.com/google/cloud-print-connector \
|
||||
urfave:cli:8e01ec4:cli/src/github.com/urfave/cli \
|
||||
satori:go.uuid:36e9d2e:gouuid/src/github.com/satori/go.uuid \
|
||||
|
34
print/cloud-print-connector/files/gcp-cups-connectord.in
Normal file
34
print/cloud-print-connector/files/gcp-cups-connectord.in
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# PROVIDE: gcp_cups_connectord
|
||||
# REQUIRE: DAEMON NETWORKING
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
# gcp_cups_connectord_enable (bool): Set to "NO" by default.
|
||||
# Set it to "YES" to enable
|
||||
#
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="gcp_cups_connectord"
|
||||
rcvar="gcp_cups_connectord_enable"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${name_enable:=no}
|
||||
|
||||
pidfile="/var/run/${name}.pid"
|
||||
command="/usr/sbin/daemon"
|
||||
bin="%%PREFIX%%/bin/gcp-cups-connector"
|
||||
start_precmd="${name}_prestart"
|
||||
|
||||
gcp_cups_connectord_prestart() {
|
||||
if [ -z "${rc_flags}" ];then
|
||||
rc_flags="-P ${pidfile} -f ${bin} -config-filename %%PREFIX%%/etc/gcp-cups-connector.config.json"
|
||||
else
|
||||
rc_flags="-P ${pidfile} -f ${bin} ${rc_flags}"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
6
print/cloud-print-connector/pkg-message
Normal file
6
print/cloud-print-connector/pkg-message
Normal file
@ -0,0 +1,6 @@
|
||||
Run the following command to create a config file called gcp-cups-connector.config.json before the starting service:
|
||||
|
||||
# gcp-connector-util init --log-file-name "/var/log/cloud-print-connectord"
|
||||
# mv /root/gcp-cups-connector.config.json /usr/local/etc/gcp-cups-connector.config.json
|
||||
|
||||
More info at: https://github.com/google/cloud-print-connector/wiki/Configuration
|
Loading…
Reference in New Issue
Block a user