remove extra else

This commit is contained in:
Alfonso Gamboa 2022-04-12 23:40:58 -07:00
parent 448941ba59
commit 9013eeb466

View File

@ -2,15 +2,30 @@
DISABLE_FW_UPGRADE="false"
HOSTNAME="WCV3_spare_test"
ENABLE_USB_ETH="false"
ENABLE_USB_DIRECT="false"
echo "run_mmc.sh start" > /dev/kmsg
echo "check if ethernet adapter is present"
if [[ ! -d /sys/class/net/eth* ]]; then
echo "usb ethernet not present"
if [[ ! -d /sys/class/net/usb0* ]]; then
echo "usb host not present"
if [[ "$ENABLE_USB_ETH" == "true" ]]; then
ifconfig eth0 down
ifconfig wlan0 down
/media/mmc/wz_mini/bin/busybox ip link set wlan0 name wlanold
/media/mmc/wz_mini/bin/busybox ip link set eth0 name wlan0
ifconfig wlan0 up
udhcpc -i wlan0
/media/mmc/wz_mini/bin/dropbearmulti dropbear -R -m &
sleep 5
mount -o bind /media/mmc/wz_mini/bin/wpa_cli.sh /bin/wpa_cli
else
echo "usb ethernet disabled"
fi
if [[ "$ENABLE_USB_DIRECT" == "true" ]]; then
# if [[ ! -d /sys/class/net/usb0* ]]; then
##ONLY WORKS WITH g_ethernet enabled kernel
ifconfig usb0 down
ifconfig wlan0 down
@ -23,20 +38,9 @@ echo "check if ethernet adapter is present"
/media/mmc/wz_mini/bin/dropbearmulti dropbear -R -m &
sleep 5
mount -o bind /media/mmc/wz_mini/bin/wpa_cli.sh /bin/wpa_cli
fi
else
ifconfig eth0 down
ifconfig wlan0 down
/media/mmc/wz_mini/bin/busybox ip link set wlan0 name wlanold
/media/mmc/wz_mini/bin/busybox ip link set eth0 name wlan0
ifconfig wlan0 up
udhcpc -i wlan0
/media/mmc/wz_mini/bin/dropbearmulti dropbear -R -m &
sleep 5
mount -o bind /media/mmc/wz_mini/bin/wpa_cli.sh /bin/wpa_cli
fi
else
echo "usb direct disabled"
fi
if [[ "$DISABLE_FW_UPGRADE" == "true" ]]; then
mkdir /tmp/Upgrade