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