#!/bin/sh log() { local _log="$(cat)" # save stdin to _log [ -z "$_log" ] && return echo "AVMMULTID: $_log" > /dev/console echo "$_log" >> /var/log/mod_net.log logger -t AVMMULTID "$_log" } multid_mode=start while [ $# -gt 0 ]; do [ "$1" == "-s" ] && multid_mode="stop" [ "$1" == "-I" ] && multid_mode="reload" shift done if [ "$multid_mode" == "start" ]; then for dns_pkg in dnsmasq bind; do if [ "$(/mod/etc/init.d/rc.$dns_pkg status 2>/dev/null)" == "stopped" ]; then /mod/etc/init.d/rc.$dns_pkg multid 2>&1 | log fi done fi /etc/init.d/rc.multid $multid_mode 2>&1 | log