Tarun Kundu | 12e3b2e | 2024-08-15 16:16:53 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | . /usr/share/dnsmasq/init-system-common |
| 4 | |
| 5 | case "$1" in |
| 6 | checkconfig) |
| 7 | checkconfig |
| 8 | ;; |
| 9 | start-resolvconf) |
| 10 | start_resolvconf |
| 11 | ;; |
| 12 | stop-resolvconf) |
| 13 | stop_resolvconf |
| 14 | ;; |
| 15 | exec) |
| 16 | # /run may be volatile, so we need to ensure that |
| 17 | # /run/dnsmasq exists here as well as in postinst |
| 18 | if [ ! -d /run/dnsmasq ]; then |
| 19 | mkdir /run/dnsmasq || { [ -d /run/dnsmasq ] || exit 2 ; } |
| 20 | chown dnsmasq:nogroup /run/dnsmasq || exit 2 |
| 21 | fi |
| 22 | exec ${DAEMON} -x /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid \ |
| 23 | ${MAILHOSTNAME:+ -m ${MAILHOSTNAME}} \ |
| 24 | ${MAILTARGET:+ -t ${MAILTARGET}} \ |
| 25 | ${DNSMASQ_USER:+ -u ${DNSMASQ_USER}} \ |
| 26 | ${DNSMASQ_INTERFACES:+ ${DNSMASQ_INTERFACES}} \ |
| 27 | ${DHCP_LEASE:+ -l ${DHCP_LEASE}} \ |
| 28 | ${DOMAIN_SUFFIX:+ -s ${DOMAIN_SUFFIX}} \ |
| 29 | ${RESOLV_CONF:+ -r ${RESOLV_CONF}} \ |
| 30 | ${CACHESIZE:+ -c ${CACHESIZE}} \ |
| 31 | ${CONFIG_DIR:+ -7 ${CONFIG_DIR}} \ |
| 32 | ${DNSMASQ_OPTS:+ ${DNSMASQ_OPTS}} |
| 33 | ;; |
| 34 | esac |