mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 17:20:30 +08:00
增强 OTG 模式容错
This commit is contained in:
parent
f222926d85
commit
758ba42838
@ -125,6 +125,7 @@ fi
|
|||||||
#Trying usb_gadget
|
#Trying usb_gadget
|
||||||
if [ "$OTG" == "1" ]; then
|
if [ "$OTG" == "1" ]; then
|
||||||
echo "Trying OTG Port..."
|
echo "Trying OTG Port..."
|
||||||
|
rm -r /run/kvmd/otg
|
||||||
modprobe libcomposite || echo -e "${RED}Linux libcomposite module modprobe failed.${NC}"
|
modprobe libcomposite || echo -e "${RED}Linux libcomposite module modprobe failed.${NC}"
|
||||||
python -m kvmd.apps.otg start \
|
python -m kvmd.apps.otg start \
|
||||||
&& ln -s /dev/hidg1 /dev/kvmd-hid-mouse \
|
&& ln -s /dev/hidg1 /dev/kvmd-hid-mouse \
|
||||||
|
|||||||
@ -10,8 +10,8 @@ cleanup() {
|
|||||||
if [ "$OTG" == "1" ]; then
|
if [ "$OTG" == "1" ]; then
|
||||||
echo "Trying exit OTG Port..." \
|
echo "Trying exit OTG Port..." \
|
||||||
&& python -m kvmd.apps.otg stop \
|
&& python -m kvmd.apps.otg stop \
|
||||||
&& rm -r /run/kvmd/otg \
|
|
||||||
|| echo -e "${RED}Failed to exit OTG Port${NC}"
|
|| echo -e "${RED}Failed to exit OTG Port${NC}"
|
||||||
|
rm -r /run/kvmd/otg
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user