Modify

Opened 22 months ago

Last modified 22 months ago

#22272 new defect

LuCI uses quotation marks for the config values where the unmodified config files don't have them

Reported by: anonymous Owned by:
Priority: normal Milestone: Designated Driver (Trunk)
Component: luci Version: Trunk
Keywords: quotation marks Cc:

Description

LuCI uses quotation marks for the config values where the unmodified config files don't have them.
This makes diffing harder.

example:
LuCI

 config defaults
-       option syn_flood '1'
-       option input 'ACCEPT'
-       option output 'ACCEPT'
-       option forward 'REJECT'

original

+       option syn_flood        1
+       option input            ACCEPT
+       option output           ACCEPT
+       option forward          REJECT

You see also space is different.

LuCI Master (git-16.108.33174-51a7f96) / OpenWrt Designated Driver r49258

Attachments (0)

Change History (2)

comment:1 Changed 22 months ago by anonymous

use uci show firewall not cat /etc/config/firewall.

comment:2 Changed 22 months ago by hnyman

It is not LuCI but uci, as LuCI uses uci to store new values.

uci stores values like your LuCI example, but not all default files in packages are using exactly that format. The default config files may also contain whitespace and comments that uci cleans away on the first modifications to the file. So a plain diff does not work well, as you noticed.

I use this script to compare defaults (= in rom) to the current config:

#!/bin/sh
cd /etc/config
for F in *
do
        echo
        echo "===== $F ====="
        uci -c /rom/etc/config export $F >/tmp/$F.default 2>/dev/null
        case $? in 0) ;; *) echo '>> no default in /rom <<' ;; esac
        uci export $F >/tmp/$F.current
        diff /tmp/$F.default /tmp/$F.current
        rm -f /tmp/$F.default /tmp/$F.current
done

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.