One-KVM/kvmd_data/etc/kvmd/clean_when_exit.sh
mofeng-git d5a0b1a8b3 初步整合:
1. python 内置服务器
2. 将配置文件统一目录
2025-01-01 14:26:22 +00:00

23 lines
396 B
Bash
Executable File

#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
NC='\033[0m'
cleanup() {
if [ "$OTG" == "1" ]; then
echo "Trying exit OTG Port..." \
&& python -m kvmd.apps.otg stop \
|| echo -e "${RED}Failed to exit OTG Port${NC}"
rm -r /run/kvmd/otg
fi
exit 0
}
trap cleanup SIGTERM
while true; do
sleep 3600
done