Skip to content

Commit

Permalink
Fix usb ether toggle script
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed Sep 25, 2024
1 parent 879d4e5 commit d99a508
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/extraFiles/rpi-usb-ether-gadget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ fi
#rm /etc/modprobe.d/g_ether.conf

if [ "$TURN_ON" = false ]; then
echo "Turning \e[31moff\e[0m USB Ethernet Gadget mode"
echo -e "Turning \e[31moff\e[0m USB Ethernet Gadget mode"
rm -f /etc/modules-load.d/usb-ether-gadget.conf
sed -i '/dtoverlay=dwc2,dr_mode=peripheral/d' /boot/firmware/config.txt
else
echo "Turning \e[32mon\e[0m USB Ethernet Gadget mode"
echo "dwc2\ng_ether\n" > /etc/modules-load.d/usb-ether-gadget.conf
echo "\ndtoverlay=dwc2,dr_mode=peripheral\n" >> /boot/firmware/config.txt
echo -e "Turning \e[32mon\e[0m USB Ethernet Gadget mode"
echo -e "dwc2\ng_ether\n" > /etc/modules-load.d/usb-ether-gadget.conf
echo -e "\ndtoverlay=dwc2,dr_mode=peripheral\n" >> /boot/firmware/config.txt
fi

echo "Reboot to apply changes"

0 comments on commit d99a508

Please sign in to comment.