Commit e325525b authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: check in scripts if dot-config option is "y"

Check in scripts if dot-config option is equal to "y" not if it is empty.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent b46f079b
......@@ -34,17 +34,17 @@ fi
rm -f "$tmpdir"/dot-config_source_url
# If we are expected to get a new dot-conf, do it
if [ -n "$CONFIG_DOTCONF_SOURCE_REMOTE" ] || [ -n "$CONFIG_DOTCONF_SOURCE_TRY_DHCP" ] \
|| [ -n "$CONFIG_DOTCONF_SOURCE_FORCE_DHCP" ]; then
if [ "$CONFIG_DOTCONF_SOURCE_REMOTE" = "y" ] || [ "$CONFIG_DOTCONF_SOURCE_TRY_DHCP" = "y" ] \
|| [ "$CONFIG_DOTCONF_SOURCE_FORCE_DHCP" = "y" ]; then
echo "remote" > "$tmpdir"/dot-config_source
# get URL via DHCP
if [ -n "$CONFIG_DOTCONF_SOURCE_TRY_DHCP" ] \
|| [ -n "$CONFIG_DOTCONF_SOURCE_FORCE_DHCP" ]; then
if [ -n "$CONFIG_DOTCONF_SOURCE_TRY_DHCP" ]; then
if [ "$CONFIG_DOTCONF_SOURCE_TRY_DHCP" = "y" ] \
|| [ "$CONFIG_DOTCONF_SOURCE_FORCE_DHCP" = "y" ]; then
if [ "$CONFIG_DOTCONF_SOURCE_TRY_DHCP" = "y" ]; then
echo "try_dhcp" > "$tmpdir"/dot-config_source
fi
if [ -n "$CONFIG_DOTCONF_SOURCE_FORCE_DHCP" ]; then
if [ "$CONFIG_DOTCONF_SOURCE_FORCE_DHCP" = "y" ]; then
echo "force_dhcp" > "$tmpdir"/dot-config_source
fi
......@@ -114,7 +114,7 @@ if [ -n "$CONFIG_DOTCONF_SOURCE_REMOTE" ] || [ -n "$CONFIG_DOTCONF_SOURCE_TRY_DH
echo "download_error" > "$tmpdir"/dot-config_status
echo "Download error for dot-config \"$URL\", using old"
fi
elif [ -n "$CONFIG_DOTCONF_SOURCE_LOCAL" ]; then
elif [ "$CONFIG_DOTCONF_SOURCE_LOCAL" = "y" ]; then
echo "local" > "$tmpdir"/dot-config_source
echo "Using local dot-config"
else
......
......@@ -51,7 +51,7 @@ init() {
loop_forever
fi
if [ -z "$CONFIG_MONIT_DISABLE" ]; then
if [ "$CONFIG_MONIT_DISABLE" != "y" ]; then
if [ -z $CONFIG_WRS_LOG_MONIT ]; then
LOG="";
......
......@@ -31,7 +31,7 @@ ip link set eth0 down
# wait after down to make udhcpc to work properly
sleep 1
if [ "$CONFIG_ETH0_STATIC" ] || [ "$CONFIG_ETH0_DHCP_ONCE" ]; then
if [ "$CONFIG_ETH0_STATIC" = "y" ] || [ "$CONFIG_ETH0_DHCP_ONCE" = "y" ]; then
echo "Write IP address"
echo "# File generated from dot-config, do not edit!" > $int_file
echo "# Configure Loopback" >> $int_file
......@@ -58,7 +58,7 @@ if [ "$CONFIG_ETH0_STATIC" ] || [ "$CONFIG_ETH0_DHCP_ONCE" ]; then
fi
if [ "$CONFIG_ETH0_DHCP_ONCE" ]; then
if [ "$CONFIG_ETH0_DHCP_ONCE" = "y" ]; then
echo "Try DHCP to get IP"
# try dhcp, if fail use static IP
udhcpc -i eth0 -n
......@@ -70,7 +70,7 @@ if [ "$CONFIG_ETH0_DHCP_ONCE" ]; then
fi
fi
if [ "$CONFIG_ETH0_STATIC" ]; then
if [ "$CONFIG_ETH0_STATIC" = "y" ]; then
# ifup to use static parameters from /etc/netwrok/interfaces
echo "Using static IP"
ifup eth0
......
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