Skip to content

Commit

Permalink
增强 OTG 模式容错
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeng-git committed Sep 29, 2024
1 parent f222926 commit 758ba42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions build/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion configs/kvmd/clean_when_exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 758ba42

Please sign in to comment.