Vielleicht wird /etc/rc.local von /bin/dash aufgerufen!
man dash:
[ expression ]
The test utility evaluates the expression and, if it evaluates to true, returns a zero
(true) exit status; otherwise it returns 1 (false). If there is no expression, test also returns 1 (false).
s1 = s2 True if the strings s1 and s2 are identical.
Dies geht also nicht:
#!/bin/dash
/bin/true
if [ $? == 0 ] ; then
echo ja
else
echo nein
fi
# auch ein NICHT dash Feature, die Doppelklammer nur Bash:
/bin/true
if [[ $? = 0 ]] ; then
echo ja
fi
Die einfache Alternative ist:
if ping NUM ; then
# hier was machen
fi
Das Doppelgleich ist wohl eine Neuerung des neuesten Bash? Als Feature für die vielen C Programmierer ....