gluon/package/gluon-wan-dnsmasq/files/etc/init.d/gluon-wan-dnsmasq
2014-08-09 14:39:05 +02:00

27 lines
515 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
LD_PRELOAD=libpacketmark.so 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
}