From 8432d25a20ebc62a9b3e7de4b33a1e5eb69457e9 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Tue, 26 Aug 2025 05:07:01 +0000 Subject: [PATCH] Fix check version sing-box --- universal_config.sh | 46 +++++++++++++++++----------------- universal_config_new_podkop.sh | 46 +++++++++++++++++----------------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/universal_config.sh b/universal_config.sh index 0e178bb..f5b9d88 100644 --- a/universal_config.sh +++ b/universal_config.sh @@ -493,30 +493,30 @@ INSTALLED_VERSION=$(opkg list-installed | grep "^$PACKAGE" | cut -d ' ' -f 3) if [ -n "$INSTALLED_VERSION" ] && [ "$INSTALLED_VERSION" != "$REQUIRED_VERSION" ]; then echo "Version package $PACKAGE not equal $REQUIRED_VERSION. Removed packages..." opkg remove --force-removal-of-dependent-packages $PACKAGE -fi + + PACK_NAME="sing-box" + AWG_DIR="/tmp/$PACK_NAME" + SINGBOX_FILENAME="sing-box_1.11.15_openwrt_aarch64_cortex-a53.ipk" + BASE_URL="https://github.com/SagerNet/sing-box/releases/download/v1.11.15/" + DOWNLOAD_URL="${BASE_URL}${SINGBOX_FILENAME}" + mkdir -p "$AWG_DIR" + #echo $DOWNLOAD_URL -PACK_NAME="sing-box" -AWG_DIR="/tmp/$PACK_NAME" -SINGBOX_FILENAME="sing-box_1.11.15_openwrt_aarch64_cortex-a53.ipk" -BASE_URL="https://github.com/SagerNet/sing-box/releases/download/v1.11.15/" -DOWNLOAD_URL="${BASE_URL}${SINGBOX_FILENAME}" -mkdir -p "$AWG_DIR" -#echo $DOWNLOAD_URL - -wget -O "$AWG_DIR/$SINGBOX_FILENAME" "$DOWNLOAD_URL" -if [ $? -eq 0 ]; then - echo "$PACK_NAME file downloaded successfully" -else - echo "Error downloading $PACK_NAME. Please, install $PACK_NAME manually and run the script again" - exit 1 -fi - -opkg install "$AWG_DIR/$SINGBOX_FILENAME" -if [ $? -eq 0 ]; then - echo "$PACK_NAME file installing successfully" -else - echo "Error installing $PACK_NAME. Please, install $PACK_NAME manually and run the script again" - exit 1 + wget -O "$AWG_DIR/$SINGBOX_FILENAME" "$DOWNLOAD_URL" + if [ $? -eq 0 ]; then + echo "$PACK_NAME file downloaded successfully" + else + echo "Error downloading $PACK_NAME. Please, install $PACK_NAME manually and run the script again" + exit 1 + fi + + opkg install "$AWG_DIR/$SINGBOX_FILENAME" + if [ $? -eq 0 ]; then + echo "$PACK_NAME file installing successfully" + else + echo "Error installing $PACK_NAME. Please, install $PACK_NAME manually and run the script again" + exit 1 + fi fi ########### diff --git a/universal_config_new_podkop.sh b/universal_config_new_podkop.sh index 486416d..cfd55cf 100644 --- a/universal_config_new_podkop.sh +++ b/universal_config_new_podkop.sh @@ -503,30 +503,30 @@ INSTALLED_VERSION=$(opkg list-installed | grep "^$PACKAGE" | cut -d ' ' -f 3) if [ -n "$INSTALLED_VERSION" ] && [ "$INSTALLED_VERSION" != "$REQUIRED_VERSION" ]; then echo "Version package $PACKAGE not equal $REQUIRED_VERSION. Removed packages..." opkg remove --force-removal-of-dependent-packages $PACKAGE -fi + + PACK_NAME="sing-box" + AWG_DIR="/tmp/$PACK_NAME" + SINGBOX_FILENAME="sing-box_1.11.15_openwrt_aarch64_cortex-a53.ipk" + BASE_URL="https://github.com/SagerNet/sing-box/releases/download/v1.11.15/" + DOWNLOAD_URL="${BASE_URL}${SINGBOX_FILENAME}" + mkdir -p "$AWG_DIR" + #echo $DOWNLOAD_URL -PACK_NAME="sing-box" -AWG_DIR="/tmp/$PACK_NAME" -SINGBOX_FILENAME="sing-box_1.11.15_openwrt_aarch64_cortex-a53.ipk" -BASE_URL="https://github.com/SagerNet/sing-box/releases/download/v1.11.15/" -DOWNLOAD_URL="${BASE_URL}${SINGBOX_FILENAME}" -mkdir -p "$AWG_DIR" -#echo $DOWNLOAD_URL - -wget -O "$AWG_DIR/$SINGBOX_FILENAME" "$DOWNLOAD_URL" -if [ $? -eq 0 ]; then - echo "$PACK_NAME file downloaded successfully" -else - echo "Error downloading $PACK_NAME. Please, install $PACK_NAME manually and run the script again" - exit 1 -fi - -opkg install "$AWG_DIR/$SINGBOX_FILENAME" -if [ $? -eq 0 ]; then - echo "$PACK_NAME file installing successfully" -else - echo "Error installing $PACK_NAME. Please, install $PACK_NAME manually and run the script again" - exit 1 + wget -O "$AWG_DIR/$SINGBOX_FILENAME" "$DOWNLOAD_URL" + if [ $? -eq 0 ]; then + echo "$PACK_NAME file downloaded successfully" + else + echo "Error downloading $PACK_NAME. Please, install $PACK_NAME manually and run the script again" + exit 1 + fi + + opkg install "$AWG_DIR/$SINGBOX_FILENAME" + if [ $? -eq 0 ]; then + echo "$PACK_NAME file installing successfully" + else + echo "Error installing $PACK_NAME. Please, install $PACK_NAME manually and run the script again" + exit 1 + fi fi ###########