From 34569fef8a003f9b68e98265420a10a45da4fe57 Mon Sep 17 00:00:00 2001 From: leo <426742@gmail.com> Date: Tue, 6 Aug 2024 21:47:44 +0500 Subject: [PATCH] changes --- socks5.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/socks5.sh b/socks5.sh index 5eb5d75..a5149a9 100644 --- a/socks5.sh +++ b/socks5.sh @@ -19,6 +19,15 @@ set -e export DEBIAN_FRONTEND=noninteractive +# Wait for unlocking: + wait_for_lock() { + while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do + echo "Waiting for /var/lib/dpkg/lock-frontend to be unlocked..." + sleep 5 + done + } + + echo "Find active network interface..." INTERFACE=$(ip -o -4 route show to default | awk '{print $5}') @@ -30,7 +39,9 @@ fi echo "Active network interface found: $INTERFACE" echo "Install dante-server..." +wait_for_lock apt-get update +wait_for_lock apt-get install -y dante-server echo "Backup existing configuration file $DANTE_CONF..."