From b4a404b42c7b3719bfd60ebef34ab19ceb129da7 Mon Sep 17 00:00:00 2001 From: Lsmoisu <114275920+Lsmoisu@users.noreply.github.com> Date: Sat, 17 May 2025 23:10:04 +0800 Subject: [PATCH] Update enablesshandcreatesocks5.sh --- enablesshandcreatesocks5.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/enablesshandcreatesocks5.sh b/enablesshandcreatesocks5.sh index fc3d182..cf57e2a 100644 --- a/enablesshandcreatesocks5.sh +++ b/enablesshandcreatesocks5.sh @@ -5,6 +5,13 @@ RED='\033[0;31m' GREEN='\033[0;32m' NC='\033[0m' # No Color +# 检查 /opt/socks.txt 文件是否存在 +if [ -f "/opt/socks.txt" ]; then + echo -e "${RED}Error: /opt/socks.txt already exists. Script will exit to avoid overwriting existing configuration.${NC}" + echo -e "${RED}If you want to re-run the script, please remove /opt/socks.txt first.${NC}" + exit 1 +fi + # 检查是否为 root 用户或通过 sudo 运行 if [ "$EUID" -ne 0 ]; then if [ -z "$SUDO_USER" ]; then