<p dir="auto">When an installation of a plugin with the <code class="notranslate">plugin</code> script fails, it returns an incorrect exit code: 0. Example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="vagrant@precise64:~$ sudo /usr/local/bin/plugin --install FOOBAR
-&gt; Installing FOOBAR...
Failed to install FOOBAR, reason: failed to download out of all possible locations..., use -verbose to get detailed information
vagrant@precise64:~$ echo $?
0"><pre class="notranslate"><code class="notranslate">vagrant@precise64:~$ sudo /usr/local/bin/plugin --install FOOBAR
-&gt; Installing FOOBAR...
Failed to install FOOBAR, reason: failed to download out of all possible locations..., use -verbose to get detailed information
vagrant@precise64:~$ echo $?
0
</code></pre></div>
<p dir="auto">This makes it cumbersome in automated scenarios; related: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="18275429" data-permission-text="Title is private" data-url="https://github.com/sous-chefs/elasticsearch/issues/124" data-hovercard-type="issue" data-hovercard-url="/sous-chefs/elasticsearch/issues/124/hovercard" href="https://github.com/sous-chefs/elasticsearch/issues/124">sous-chefs/elasticsearch#124</a></p>
<p dir="auto">Steps to reproduce:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ sudo /usr/share/elasticsearch/bin/plugin -install foo
-&gt; Installing foo...
Failed to install foo, reason: failed to download out of all possible locations..., use -verbose to get detailed information
$ echo $?
0"><pre class="notranslate"><code class="notranslate">$ sudo /usr/share/elasticsearch/bin/plugin -install foo
-&gt; Installing foo...
Failed to install foo, reason: failed to download out of all possible locations..., use -verbose to get detailed information
$ echo $?
0
</code></pre></div>
<p dir="auto">Expected result: The exit code should be != 0</p>
<p dir="auto">Actual result: The exit code is 0</p>