Merge pull request #44 from torbennehmer/master

Fix issue #39, interface configuration
This commit is contained in:
Daniel Adolfsson 2019-05-06 21:17:39 +02:00 committed by GitHub
commit b7571fdaa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 3 deletions

21
ndppd-init-debian-jessi Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: ndppd
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: ndppd init script
# Description: NDP Proxy Daemon init script
### END INIT INFO
# Author: Torben Nehmer <torben+ndppd@nehmer.net>
DESC="NDP Proxy Daemon"
PIDFILE=/run/ndppd.pid
DAEMON=/usr/local/sbin/ndppd
DAEMON_ARGS="-d -p $PIDFILE"

View File

@ -351,9 +351,6 @@ int main(int argc, char* argv[], char* env[])
if (cf.is_null()) if (cf.is_null())
return -1; return -1;
if (!configure(cf))
return -1;
if (daemon) { if (daemon) {
logger::syslog(true); logger::syslog(true);
@ -361,6 +358,9 @@ int main(int argc, char* argv[], char* env[])
return 1; return 1;
} }
if (!configure(cf))
return -1;
if (!pidfile.empty()) { if (!pidfile.empty()) {
std::ofstream pf; std::ofstream pf;
pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc); pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc);