@@ -56,7 +56,7 @@ LAST_VER=$(sed -n 1p "$LAST_OPVER" 2>/dev/null |sed "s/^v//g" |tr -d "\n")
5656if [ -x " /bin/opkg" ]; then
5757 OP_CV=$( rm -f /var/lock/opkg.lock && opkg status luci-app-openclash 2> /dev/null | grep ' Version' | awk -F ' Version: ' ' {print $2}' 2> /dev/null)
5858elif [ -x " /usr/bin/apk" ]; then
59- OP_CV=$( apk list luci-app-openclash 2> /dev/null| grep ' installed' | grep -oE ' [0-9]+(\.[0-9]+)*' | head -1 2> /dev/null)
59+ OP_CV=$( apk list luci-app-openclash 2> /dev/null| grep " installed" | grep -oE ' [0-9]+(\.[0-9]+)*' | head -1 2> /dev/null)
6060fi
6161OP_LV=$( sed -n 1p " $LAST_OPVER " 2> /dev/null | sed " s/^v//g" | tr -d " \n" )
6262RELEASE_BRANCH=$( uci_get_config " release_branch" || echo " master" )
@@ -227,7 +227,7 @@ check_install_success()
227227 if [ -x "/bin/opkg" ]; then
228228 current_version=$(rm -f /var/lock/opkg.lock && opkg status luci-app-openclash 2>/dev/null |grep 'Version' |awk -F 'Version: ' '{print $2}' 2>/dev/null)
229229 elif [ -x "/usr/bin/apk" ]; then
230- current_version=$(apk list luci-app-openclash 2>/dev/null|grep ' installed' | grep -oE '[0-9]+(\.[0-9]+)*' | head -1 2>/dev/null)
230+ current_version=$(apk list luci-app-openclash 2>/dev/null |grep " installed" | grep -oE '[0-9]+(\.[0-9]+)*' | head -1 2>/dev/null)
231231 fi
232232
233233 if [ -n "$current_version" ] && [ "$current_version" = "$target_version" ]; then
@@ -260,7 +260,7 @@ install_missing_packages() {
260260 done
261261 elif [ -x "/usr/bin/apk" ]; then
262262 for pkg in $installed_before; do
263- if ! apk info "$pkg" >/dev/null 2>&1; then
263+ if ! apk list "$pkg" |grep "installed " >/dev/null 2>&1; then
264264 local retry_count=0
265265 local max_retries=3
266266 while [ $retry_count -lt $max_retries ]; do
@@ -298,7 +298,7 @@ while [ $install_retry_count -lt $max_install_retries ]; do
298298 opkg install /tmp/openclash.ipk
299299 elif [ -x "/usr/bin/apk" ]; then
300300 for pkg in $packages_to_check; do
301- if apk info "$pkg" >/dev/null 2>&1; then
301+ if apk list "$pkg" |grep "installed " >/dev/null 2>&1; then
302302 installed_before="$installed_before $pkg"
303303 fi
304304 done
0 commit comments