gluon/package/gluon-wan-dnsmasq/files/etc/init.d/gluon-wan-dnsmasq
Nils Schneider d9df118686 gluon-wan-dnsmasq: fix usage of libpacketmark
Using service_start requires exporting of environment variables.

Fixes #397
2015-08-04 22:51:40 +02:00

30 lines
532 B
Bash
Executable File

#!/bin/sh /etc/rc.common
START=60
SERVICE_NAME=gluon-wan-dnsmasq
SERVICE_USE_PID=1
SERVICE_PID_FILE=/var/run/gluon-wan-dnsmasq.pid
PORT=54
PACKET_MARK=1
RESOLV_CONF_DIR=/var/gluon/wan-dnsmasq
RESOLV_CONF=$RESOLV_CONF_DIR/resolv.conf
start() {
mkdir -p $RESOLV_CONF_DIR
/lib/gluon/wan-dnsmasq/update.lua
export LD_PRELOAD=libpacketmark.so
export LIBPACKETMARK_MARK=$PACKET_MARK
service_start /usr/sbin/dnsmasq -x $SERVICE_PID_FILE -u root -i lo -p $PORT -h -r $RESOLV_CONF
}
stop() {
service_stop /usr/sbin/dnsmasq
}