blob: 8abbf68254933b47f03e8eb6f881f9353c5dd659 (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#!/bin/sh /etc/rc.common
START=19
USE_PROCD=1
QUIET=""
validate_firewall_redirect()
{
uci_validate_section firewall redirect "${1}" \
'proto:or("tcp", "udp", "tcpudp")' \
'src:string' \
'src_ip:ipaddr' \
'src_dport:string' \
'dest:string' \
'dest_ip:ipaddr' \
'dest_port:string' \
'target:or("SNAT", "DNAT")'
return $?
}
validate_firewall_rule()
{
uci_validate_section firewall rule "${1}" \
'proto:string' \
'src:string' \
'dest:string' \
'src_port:string' \
'dest_port:string' \
'target:string'
return $?
}
service_triggers() {
procd_add_reload_trigger firewall
procd_open_validate
validate_firewall_redirect
validate_firewall_rule
procd_close_validate
}
restart() {
fw3 restart
}
start_service() {
fw3 ${QUIET} start
}
stop_service() {
fw3 flush
}
reload_service() {
fw3 reload
}
boot() {
# Be silent on boot, firewall might be started by hotplug already,
# so don't complain in syslog.
QUIET=1
start
}
|