0
0
mirror of https://github.com/openwrt/packages.git synced 2025-02-12 04:38:06 +00:00
packages/net/netatalk/files/macipgw.init
Antonio Pastor 900e71b607 netatalk: add uci support
Signed-off-by: Antonio Pastor <antonio.pastor@gmail.com>
2025-02-02 19:12:30 +08:00

27 lines
645 B
Bash
Executable File

#!/bin/sh /etc/rc.common
START=94
USE_PROCD=1
PROG=/usr/sbin/macipgw
start_service() {
config_load macipgw
config_get disabled macipgw disabled '0'
[ "$disabled" = "0" ] || {
logger -p info -t macipgw "Disabled by config" && exit
}
config_get network macipgw network 127.0.0.1
config_get netmask macipgw netmask 255.255.255.0
config_get nameserver macipgw nameserver
[ -z "$nameserver" ] || nameserver="-n $nameserver"
config_get zone macipgw zone
[ -z "$zone" ] || zone="-z $zone"
procd_open_instance
procd_set_param command $PROG -d 0x1 $zone $nameserver $network $netmask
procd_set_param respawn
procd_close_instance
}