switch to logger (more POSIX)

This commit is contained in:
2026-07-02 11:04:19 +00:00
parent 9f51718235
commit 39c0f158fe
+6 -4
View File
@@ -12,17 +12,19 @@ fi
# Is the dwc2 overlay installed? Nothing will work if it isn't.
if lsmod | grep -q "dwc2"; then
systemd-cat -t gadget.sh -p info echo "DWC2 module loaded, setting up OTG gadget serial and ethernet"
echo "DWC2 module loaded, setting up OTG gadget serial and ethernet" | logger -t $0 -p info
echo "DWC2 module loaded"
else
systemd-cat -t gadget.sh -p warning echo "DWC2 module missing. Aborting OTG setup."
echo "DWC2 module missing. Aborting OTG setup." | logger -t $0 -p info
echo "DWC2 module missing"
systemctl disable serial-getty@ttyGS0.service
exit 1
fi
sudo modprobe libcomposite
modprobe libcomposite
cd /sys/kernel/config/usb_gadget
if [ -d "MyGadget" ]; then
systemd-cat -t gadget.sh -p warning echo "MyGadget already exists. Aborting OTG setup."
echo "MyGadget already exists. Aborting OTG setup." | logger -t $0 -p info
exit 1
fi