diff options
Diffstat (limited to 'net-misc/badvpn/files/badvpn-ncd.init')
-rw-r--r-- | net-misc/badvpn/files/badvpn-ncd.init | 47 |
1 files changed, 10 insertions, 37 deletions
diff --git a/net-misc/badvpn/files/badvpn-ncd.init b/net-misc/badvpn/files/badvpn-ncd.init index 6714faf91992..dba4c9af56d8 100644 --- a/net-misc/badvpn/files/badvpn-ncd.init +++ b/net-misc/badvpn/files/badvpn-ncd.init @@ -2,49 +2,22 @@ # Copyright 1999-2012 Gentoo Foundation # Released under the 3-clause BSD license. -NCD_PIDFILE="/var/run/${SVCNAME}.pid" -NCD_NAME=${NCD_NAME:-"Network Configuration Daemon"} -NCD_SYSLOG_IDENT=${NCD_SYSLOG_IDENT:-"ncd"} -NCD_EXEC=${NCD_EXEC:-"/usr/bin/badvpn-ncd"} +command="${ncd_exec:-"/usr/bin/badvpn-ncd"}" +command_args="${ncd_args} --config-file ${ncd_config:-/etc/ncd.conf}" +command_background="YES" +description="Network Configuration Daemon" +pidfile="/var/run/${RC_SVCNAME}.pid" depend() { - need net + need localmount after bootmisc before netmount } -start() { - ebegin "Starting ${NCD_NAME}" - - local args=( - "${NCD_ARGS[@]}" - --config-file - "${NCD_CONFIG}" - ) - if [ "$NCD_SYSLOG_IDENT" != "none" ]; then - args=( - "${args[@]}" +start_pre() { + if yesno "${ncd_syslog:-NO}"; then + command_args="${command_args} --logger syslog - --syslog-ident "$NCD_SYSLOG_IDENT" - ) + --syslog-ident \"${ncd_syslog_ident:-${RC_SVCNAME}}\"" fi - - start-stop-daemon \ - --start \ - --pidfile "${NCD_PIDFILE}" \ - --background \ - --make-pidfile \ - --exec "${NCD_EXEC}" -- "${args[@]}" - - eend $? "Failed to start ${NCD_NAME}" -} - -stop() { - ebegin "Stopping ${NCD_NAME}" - - start-stop-daemon \ - --stop \ - --pidfile "${NCD_PIDFILE}" - - eend $? "Failed to stop ${NCD_NAME}" } |