summaryrefslogtreecommitdiffstats
path: root/net/netatalk/files/macipgw.init
blob: cd6c7af126220abe483459188488fef0033275a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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
}