ifup/down broken!!!

David Henderson dhenderson at digital-pipe.com
Thu Sep 29 12:52:11 UTC 2016


On 9/28/16, Xabier Oneca  --  xOneca <xoneca at gmail.com> wrote:
> Hello David,
>
>> However, as noted, it appears that the script was having an 'exit 1'
>> even though it was going through all the lines and should have been
>> exiting 0.  Once one of the lines further up in the script was
>> commented out, it would exit correctly.  For some reason the script
>> wasn't giving an 'exit 0' by running all the way through - as it
>> should be doing.
>
> I tried your script adding 'set -x' before your first line of code, so
> I can see the execution trace of the script:
>
> + echo resolv.conf
> + env
> + CONFIG=
> + '[' -e /etc/network/interfaces ']'
> + echo eth0
> + grep -q :
> + '[' '' '!=' '' ']'
>
> In my case /etc/network/interfaces does exist, so the first "fail" is in
>
>   ( echo "$IFACE" | grep -q ':' )
>
> This skips the next full block of code. The next command is to check
> if $CONFIG is not empty (not the case, as you can see in the execution
> trace). As Dietmar explained, that's the command likely having your
> script returning 1, since scripts always exit with the status of the
> last command executed.
>
> HTH,
>
> Xabier Oneca_,,_
>

Good morning Xabier, thanks for the help!  During my testing (I will
do so again this afternoon), I commented out just the last line and it
exited status 1.  I then commented out the next block of code (the one
with 'grep') and that stopped the script from exiting 1.  After I do
the test again, I'll let you know.

Dave


More information about the busybox mailing list