catch all special characters in replacement

This commit is contained in:
Christof Schulze 2016-04-24 13:12:40 +02:00
parent 7f66481a70
commit be6a6f3746

View File

@ -18,8 +18,8 @@ uci:delete_all('babeld', 'interface')
pcall( function()
for interface in io.lines(interfaces) do
int = string.gsub(interface,'[.-]','_')
uci:section('babeld', 'interface', 'interface_' .. int, { ifname = interface })
local section = interface:gsub('[^%w_]','_')
uci:section('babeld', 'interface', 'interface_' .. section, { ifname = interface })
end
end)