mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-27 12:50:35 +03:00
updater: Add uninstall oldest mdig and ip2net packages
This commit is contained in:
@@ -75,9 +75,13 @@ ZAP_PKG_URL=
|
||||
if command -v apk >/dev/null; then
|
||||
PKG_MGR=apk
|
||||
ZAP_PKG_EXT=apk
|
||||
PKG_CHECK="apk info -e "
|
||||
PKG_REMOVE="apk del --force "
|
||||
elif command -v opkg >/dev/null; then
|
||||
PKG_MGR=opkg
|
||||
ZAP_PKG_EXT=ipk
|
||||
PKG_CHECK="opkg status "
|
||||
PKG_REMOVE="opkg remove --force-remove "
|
||||
else
|
||||
echo "ERROR: No package manager found"
|
||||
return 1
|
||||
@@ -525,6 +529,14 @@ if [ "$opt_update" != "" ]; then
|
||||
if [ "$opt_forced" = true ]; then
|
||||
pkg_mgr_update
|
||||
fi
|
||||
if ${PKG_CHECK} ${ZAPRET_CFG_NAME}-mdig >/dev/null 2>&1; then
|
||||
echo "Uninstall mdig..."
|
||||
${PKG_REMOVE} ${ZAPRET_CFG_NAME}-mdig
|
||||
fi
|
||||
if ${PKG_CHECK} ${ZAPRET_CFG_NAME}-ip2net >/dev/null 2>&1; then
|
||||
echo "Uninstall ip2net..."
|
||||
${PKG_REMOVE} ${ZAPRET_CFG_NAME}-ip2net
|
||||
fi
|
||||
echo "Install downloaded packages..."
|
||||
if [ "$PKG_MGR" != "apk" ]; then
|
||||
opkg install --force-reinstall "$ZAP_PKG_BASE_FN"
|
||||
|
||||
Reference in New Issue
Block a user