1
0
mirror of https://github.com/freifunk-gluon/packages.git synced 2024-06-16 20:24:07 +02:00
gluon-packages/gluon/gluon-core/files/lib/gluon/upgrade/140-firewall-rules
Matthias Schiffer 3d027847c6 Move all upgrade scripts to a common directory
Moving the scripts to a common directory not only vastly simplifies the
zzz-gluon-upgrade script, but also allows to define an ordering of such
scripts across packages.
2015-01-24 11:27:47 +01:00

31 lines
568 B
Lua
Executable File

#!/usr/bin/lua
local site = require 'gluon.site_config'
local uci = require 'luci.model.uci'
local c = uci.cursor()
local function reject_input_on_wan(zone)
if zone.name == 'wan' then
c:set('firewall', zone['.name'], 'input', 'REJECT')
c:set('firewall', zone['.name'], 'conntrack', '1')
end
return true
end
c:foreach('firewall', 'zone', reject_input_on_wan)
c:section('firewall', 'rule', 'wan_ssh',
{
name = 'wan_ssh',
src = 'wan',
dest_port = '22',
proto = 'tcp',
target = 'ACCEPT',
}
)
c:save('firewall')
c:commit('firewall')