summaryrefslogtreecommitdiff
blob: ccc95ac80addb0f5a09914ab80d3b9fd5860ef53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

: ${KEYFILE:="/etc/spiped/keyfile"}
: ${SPIPED_USER:="nobody"}

command="/usr/sbin/spiped"
command_args="${OPTS}
	-s [${SRCHOST}]:${SRCPORT}
	-t ${TARGETHOST}:${TARGETPORT}
	-k ${KEYFILE}
	-F"
command_background="true"
command_user="${SPIPED_USER}"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
	use net
	before logger
}

checkconfig() {
  if [[ ! "$IS_CONFIGURED" == "yes" ]]; then
    eerror "You need to setup /etc/conf.d/spiped first!"
    return 1
  fi
}

start_pre() {
	checkconfig || return 1
}