Quote:
Originally Posted by NiLuJe
* Yeah, it only writes the state to the config if retainStateOverRestart is enabled in the [state] section... :/.
* I may have totally missed how the parser handled ini sections...  .
i.e., the test should probably be grep -q "invertActive = yes", since state is the section, so, a [state] header, and not a state: prefix like it's handled in the code.
|
I think we're in business! The above 2 things are the key.
However, when NightMode rewrites nightmode.ini, the format of the line changes slightly.
Original .ini:
Code:
[state]
invertActive = no # yes / no
Re-written .ini:
Code:
[state]
invertActive = no
So I think a regex will fix that. After a bit of googling I came up with this. Does it look OK?
Code:
if grep -Eq "invertActive\s*=\s*yes" "/mnt/onboard/.kobo/nightmode.ini" ; then