增强 OTG 模式容错

This commit is contained in:
mofeng-git 2024-09-29 23:38:13 +08:00
parent f222926d85
commit 758ba42838
2 changed files with 2 additions and 1 deletions

View File

@ -125,6 +125,7 @@ fi
#Trying usb_gadget
if [ "$OTG" == "1" ]; then
echo "Trying OTG Port..."
rm -r /run/kvmd/otg
modprobe libcomposite || echo -e "${RED}Linux libcomposite module modprobe failed.${NC}"
python -m kvmd.apps.otg start \
&& ln -s /dev/hidg1 /dev/kvmd-hid-mouse \

View File

@ -10,8 +10,8 @@ cleanup() {
if [ "$OTG" == "1" ]; then
echo "Trying exit OTG Port..." \
&& python -m kvmd.apps.otg stop \
&& rm -r /run/kvmd/otg \
|| echo -e "${RED}Failed to exit OTG Port${NC}"
rm -r /run/kvmd/otg
fi
exit 0
}