Commit 049e8b55 authored by Alessandro Rubini's avatar Alessandro Rubini

apply-dot-config: fix wrong sh syntax (unexposed bug)

In sh, string comparison for equality is "=", not "==". Bash accepts
either operator but suggests to use "=" for posix conformance.
Our /bin/sh is currently busybox, which accepts "==" like bash, but
if you use ash or dash it fails:

   $ CONFIG_FOO=y
   $ if [ "$CONFIG_FOO" = "y" ]; then echo ok; fi
   ok
   $ if [ "$CONFIG_FOO" == "y" ]; then echo ok; fi
   dash: 3: [: y: unexpected operator
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 8e2751c1
......@@ -17,7 +17,7 @@ tmpdir=/tmp
T=$(mktemp "$tmpdir"/config-XXXXXX)
# check if config is local, used by webinterface
if [ "$1" == "local_config" ]; then
if [ "$1" = "local_config" ]; then
# remove source information in case previous config was received from
# network
rm "$tmpdir"/dot-config_*
......@@ -166,7 +166,7 @@ if [ "$CONFIG_MONIT_DISABLE" != "y" ]; then
process=`basename $config .conf`
monitor=1
case $process in
lldpd) if [ "$CONFIG_LLDPD_DISABLE" == "y" ] ; then
lldpd) if [ "$CONFIG_LLDPD_DISABLE" = "y" ] ; then
monitor=0
fi
;;
......@@ -174,7 +174,7 @@ if [ "$CONFIG_MONIT_DISABLE" != "y" ]; then
monitor=0;
fi
;;
lighttpd) if [ "$CONFIG_HTTPD_DISABLE" == "y" ] ; then
lighttpd) if [ "$CONFIG_HTTPD_DISABLE" = "y" ] ; then
monitor=0
fi
;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment