#!/bin/sh /etc/rc.common # Copyright (C) 2006-2011 OpenWrt.org START=50 section_enabled() { local enabled config_get_bool enabled "$1" 'enabled' 0 [ $enabled -gt 0 ] } append_interface() { local name="$1" local interface config_get interface "$name" 'ifname' "$name" append args "$interface" } start_instance() { local section="$1" local permanent local interfaces local args="" section_enabled "$section" || return 1 config_get_bool permanent "$section" 'permanent' 0 [ $permanent -eq 0 ] || append args "-p" config_list_foreach "$section" 'interfaces' append_interface service_start /usr/sbin/parprouted $args } start() { include /lib/network scan_interfaces config_load 'parprouted' config_foreach start_instance 'parprouted' } stop() { service_stop /usr/sbin/parprouted }