49 lines
1.2 KiB
Bash
Executable File
49 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
. /lib/functions.sh
|
|
. /lib/gluon/functions/sysconfig.sh
|
|
|
|
|
|
uci_remove batman-adv bat0
|
|
uci_add batman-adv mesh bat0
|
|
uci_set batman-adv bat0 orig_interval '5000'
|
|
uci_set batman-adv bat0 gw_mode 'client'
|
|
uci_commit batman-adv
|
|
|
|
uci_set network client macaddr "$(sysconfig primary_mac)"
|
|
uci_set network client peerdns '1'
|
|
|
|
uci_remove network bat0
|
|
uci_add network interface bat0
|
|
uci_set network bat0 ifname 'bat0'
|
|
uci_set network bat0 proto 'none'
|
|
uci_set network bat0 macaddr "$(sysconfig primary_mac)"
|
|
uci_commit network
|
|
|
|
uci_remove firewall client
|
|
uci_add firewall zone client
|
|
uci_set firewall client name 'client'
|
|
uci add_list firewall.client.network='client'
|
|
uci_set firewall client input 'ACCEPT'
|
|
uci_set firewall client output 'ACCEPT'
|
|
uci_set firewall client forward 'REJECT'
|
|
|
|
config_load firewall
|
|
accept_input_on_wan() {
|
|
config_get name "$1" name
|
|
[ "$name" = 'wan' ] && uci_set firewall "$1" input 'ACCEPT'
|
|
}
|
|
config_foreach accept_input_on_wan 'zone'
|
|
|
|
uci_commit firewall
|
|
|
|
uci_set dhcp '@dnsmasq[0]' boguspriv '0'
|
|
uci_set dhcp '@dnsmasq[0]' localise_queries '0'
|
|
uci_set dhcp '@dnsmasq[0]' rebind_protection '0'
|
|
|
|
uci_remove dhcp client
|
|
uci_add dhcp dhcp client
|
|
uci_set dhcp client interface 'client'
|
|
uci_set dhcp client ignore '1'
|
|
uci_commit dhcp
|