This commit is contained in:
sofia
2026-01-25 00:03:30 +08:00
parent aec40082b1
commit 4e0417c951
6 changed files with 253 additions and 190 deletions

View File

@@ -3,13 +3,13 @@
check_port() {
if [ "$1" -gt 65535 ] || [ "$1" -le 1 ]; then
echo -e "\033[31m输入错误请输入正确的数值(1-65535)\033[0m"
msg_alert "\033[31m输入错误请输入正确的数值(1-65535)\033[0m"
return 1
elif echo "|$mix_port|$redir_port|$dns_port|$db_port|" | grep -q "|$1|"; then
echo -e "\033[31m输入错误请不要输入重复的端口\033[0m"
msg_alert "\033[31m输入错误请不要输入重复的端口\033[0m"
return 1
elif netstat -ntul | grep -q ":$1[[:space:]]"; then
echo -e "\033[31m当前端口已被其他进程占用请重新输入\033[0m"
msg_alert "\033[31m当前端口已被其他进程占用请重新输入\033[0m"
return 1
else
return 0