From 205f5dd099a46fa0d6ebe4c0998897c9e3ca4795 Mon Sep 17 00:00:00 2001 From: yhydev Date: Sat, 13 Dec 2025 23:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=BD=AF=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E6=8C=87=E5=90=91=E6=AD=A3=E7=A1=AE=E7=9A=84=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/start-agent.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/start-agent.sh b/scripts/start-agent.sh index a7e8604..9c0be53 100644 --- a/scripts/start-agent.sh +++ b/scripts/start-agent.sh @@ -37,8 +37,19 @@ if [ ! -d $WORKING_DIR/user_data ]; then freqtrade create-userdir --userdir $WORKING_DIR/user_data; fi mkdir -p $WORKING_DIR/user_data/data/binance; -if [ ! -L $WORKING_DIR/user_data/data/binance/futures ]; then -ln -s $BINANCE_FUTURES_DIR $WORKING_DIR/user_data/data/binance/futures; +# Check if the symlink exists and points to the correct directory +SYMLINK_PATH="$WORKING_DIR/user_data/data/binance/futures" +if [ -L "$SYMLINK_PATH" ]; then + # Get the actual target of the symlink + CURRENT_TARGET=$(readlink "$SYMLINK_PATH") + if [ "$CURRENT_TARGET" != "$BINANCE_FUTURES_DIR" ]; then + echo "Symlink exists but points to wrong target. Removing and recreating..." + rm -f "$SYMLINK_PATH" + ln -s "$BINANCE_FUTURES_DIR" "$SYMLINK_PATH" + fi +else + # Symlink doesn't exist, create it + ln -s "$BINANCE_FUTURES_DIR" "$SYMLINK_PATH" fi; cd $WORKING_DIR; if [ ! -f ~/.local/bin/mc ]; then