<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 4, 2020 at 9:04 PM <<a href="mailto:mail@adrianschmutzler.de">mail@adrianschmutzler.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>>> prepend 'uci' to 'commit network'<br>
>> Can you explain why the prepend of 'uci' is required ?<br>
>> In other words what is not working as I fail to spot the issue<br>
><br>
> I think the author is right. "commit" is no command but an argument to the uci command.<br>
> I've tested the script and it works fine for me ..<br>
> So I want to understand what is failing ...<br>
<br>
uci-defaults "scripts" are implemented here:<br>
<a href="https://github.com/openwrt/openwrt/blob/master/package/base-files/files/lib/functions.sh#L256-L263" rel="noreferrer" target="_blank">https://github.com/openwrt/openwrt/blob/master/package/base-files/files/lib/functions.sh#L256-L263</a><br>
<br>
As you see, after all of them have been sourced a global "uci commit" is called anyway.<br>
<br>
So, after all, the "uci commit something" statements in uci-defaults files are actually not strictly necessary. However, many authors prefer to have committed what they touch directly in the uci-defaults script.<br>
This is handled relatively inconsistently across OpenWrt main/packages repos, I once had a look into it and found that it was about 50:50 back then (having a commit in the file vs. not having it).<br></blockquote><div>I observed the same inconsistency across the code base which makes it hard to refer to a default way of working  <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
However, I'd still expect the "commit network" to produce some error anywhere.<br></blockquote><div>I did not see an issue when doing a quick test as the global 'uci commit' covered up the issue for me<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
But instead of adding the "uci" in front, another working solution would be to just drop the line entirely.<br></blockquote><div>Agree and I would prefer this solution</div><div><br></div><div>Thx,<br></div><div>Hans<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Best<br>
<br>
Adrian<br>
</blockquote></div></div>