<p>Addresses commotion-openwrt issue73: <a href="https://github.com/opentechinstitute/commotion-openwrt/issues/73" class="issue-link" title="thisnode alias setting leaves unsaved changes in UCI">#73</a></p>

<p>TO TEST:</p>

<p>1a) Before running quickstart, type 'thisnode' into your browser. You should get the admin page.<br>
Do not run quickstart yet.</p>

<p>1b) Telnet into the node. <br>
$ logread | grep commotion.hotplug.thisnode</p>

<p>You should see:<br>
"Adding thisnode to /etc/hosts"<br>
"Checking for UCI entry for thisnode alias"<br>
"No entry found. Creating UCI entry for 'thisnode' alias"<br>
"Setting 'thisnode' ip address to 169.254.xx.xx"</p>

<p>1c) Go back to your browser. Run quickstart.</p>

<p>1d) Log into the node again.<br>
$ logread | grep commotion.hotplug.thisnode</p>

<p>You should see:<br>
"Found thisnode in /etc/hosts"<br>
"Checking for UCI entry for thisnode alias"<br>
"thisnode alias exists with ip address 169.254.xx.xx"</p>

<p>Since we're here, let's just do a sanity check:</p>

<p>$ less /etc/hosts</p>

<p>You should see an entry for 'thisnode'</p>

<p>$ less /etc/config/network</p>

<p>You should see a config section for 'alias'<br>
The type is plug, ip addr is 169.254.xx.xx, proto is static, netmask is 255.255.0.0</p>

<p>2) ........</p>

<p>3) PROFIT!</p>

<hr>

<h4>You can merge this Pull Request by running</h4>
<pre>  git pull https://github.com/opentechinstitute/commotion-openwrt issue73</pre>
<p>Or view, comment on, or merge it at:</p>
<p>  <a href='https://github.com/opentechinstitute/commotion-openwrt/pull/74'>https://github.com/opentechinstitute/commotion-openwrt/pull/74</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>added uci commit call</li>
  <li>added check for thisnode alias, to limit writes to disk</li>
  <li>modularized thisnode check</li>
  <li>fixed logic for alias check and added logging</li>
  <li>fixed if statement</li>
  <li>MOAR logging</li>
  <li>removed unnecessary editing of hosts file and added new check</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/opentechinstitute/commotion-openwrt/pull/74/files#diff-0">default-files/etc/hotplug.d/iface/90-thisnode</a>
    (29)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/opentechinstitute/commotion-openwrt/pull/74.patch'>https://github.com/opentechinstitute/commotion-openwrt/pull/74.patch</a></li>
  <li><a href='https://github.com/opentechinstitute/commotion-openwrt/pull/74.diff'>https://github.com/opentechinstitute/commotion-openwrt/pull/74.diff</a></li>
</ul>