diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 10:05:37 -0700 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-22 21:26:31 -0400 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | talos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz talos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper')
-rw-r--r-- | meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper new file mode 100644 index 000000000..db54d467e --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper @@ -0,0 +1,62 @@ +#!/bin/bash +# +# Borrowing heavily from the dnsmasq initscript's version of support for +# resolvconf, intended for use in systemd-only configurations. +# +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/dnsmasq +NAME=dnsmasq + +# Most configuration options in /etc/default/dnsmasq are deprecated +# but still honoured. +if [ -r /etc/default/$NAME ]; then + . /etc/default/$NAME +fi + +start_resolvconf() +{ + # If interface "lo" is explicitly disabled in /etc/default/dnsmasq + # Then dnsmasq won't be providing local DNS, so don't add it to + # the resolvconf server set. + for interface in $DNSMASQ_EXCEPT + do + [ $interface = lo ] && return + done + + if [ -x /sbin/resolvconf ] ; then + echo "nameserver 127.0.0.1" | + /sbin/resolvconf -a lo.$NAME + fi + return 0 +} + +stop_resolvconf() +{ + if [ -x /sbin/resolvconf ] ; then + /sbin/resolvconf -d lo.$NAME + fi + return 0 +} + +case "$1" in + start) + start_resolvconf + exit 0 + ;; + stop) + stop_resolvconf + exit 0 + ;; + restart) + stop_resolvconf + start_resolvconf + exit 0 + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|stop|restart}" >&2 + exit 3 + ;; +esac + +exit 0 + |