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