From f76e70aeb34777f0353a4a4f4f359e6bec6dd234 Mon Sep 17 00:00:00 2001 From: Denis Shatskiy Date: Fri, 11 Jul 2025 17:50:35 +0700 Subject: [PATCH] update --- scripts/start.sh | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index 1f4575f..905b8ce 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -20,23 +20,36 @@ chmod 755 /app/data # Удаление старых named pipes если они существуют echo "Cleaning up old named pipes..." -rm -f /run/exabgp/exabgp.in /run/exabgp/exabgp.out -rm -f /var/run/exabgp/exabgp.in /var/run/exabgp/exabgp.out -rm -f /usr/local/run/exabgp/exabgp.in /usr/local/run/exabgp/exabgp.out -rm -f /usr/local/var/run/exabgp/exabgp.in /usr/local/var/run/exabgp/exabgp.out +for dir in /run/exabgp /var/run/exabgp /usr/local/run/exabgp /usr/local/var/run/exabgp; do + if [ -d "$dir" ]; then + echo "Cleaning $dir..." + rm -f $dir/exabgp.in $dir/exabgp.out + rmdir $dir 2>/dev/null || true + fi +done # Создание named pipes для CLI в стандартном месте echo "Creating named pipes for ExaBGP CLI..." -mkdir -p /run/exabgp -mkfifo /run/exabgp/exabgp.in /run/exabgp/exabgp.out -chmod 666 /run/exabgp/exabgp.in /run/exabgp/exabgp.out - -# Также создаем в других стандартных местах -for dir in /var/run/exabgp /usr/local/run/exabgp /usr/local/var/run/exabgp; do +for dir in /run/exabgp /var/run/exabgp /usr/local/run/exabgp /usr/local/var/run/exabgp; do mkdir -p $dir echo "Creating named pipes in $dir..." - mkfifo $dir/exabgp.in $dir/exabgp.out - chmod 666 $dir/exabgp.in $dir/exabgp.out + + # Проверяем, существуют ли уже named pipes + if [ ! -p "$dir/exabgp.in" ]; then + mkfifo $dir/exabgp.in + chmod 666 $dir/exabgp.in + echo "Created $dir/exabgp.in" + else + echo "Named pipe $dir/exabgp.in already exists" + fi + + if [ ! -p "$dir/exabgp.out" ]; then + mkfifo $dir/exabgp.out + chmod 666 $dir/exabgp.out + echo "Created $dir/exabgp.out" + else + echo "Named pipe $dir/exabgp.out already exists" + fi done # Проверка наличия файлов с префиксами