From be6a6f3746165c1c9c98c28ea89c7bc0aafeedfe Mon Sep 17 00:00:00 2001 From: Christof Schulze Date: Sun, 24 Apr 2016 13:12:40 +0200 Subject: [PATCH] catch all special characters in replacement --- .../files/lib/gluon/upgrade/330-gluon-mesh-babel-interfaces | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/gluon-mesh-babel/files/lib/gluon/upgrade/330-gluon-mesh-babel-interfaces b/package/gluon-mesh-babel/files/lib/gluon/upgrade/330-gluon-mesh-babel-interfaces index a50ab48b..fca7101f 100755 --- a/package/gluon-mesh-babel/files/lib/gluon/upgrade/330-gluon-mesh-babel-interfaces +++ b/package/gluon-mesh-babel/files/lib/gluon/upgrade/330-gluon-mesh-babel-interfaces @@ -16,10 +16,10 @@ end uci:delete_all('babeld', 'interface') -pcall(function() +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)