mirror of
https://github.com/routerich/RouterichAX3000_configs.git
synced 2025-12-06 11:36:43 +03:00
Add check if alt firmware
This commit is contained in:
@@ -120,25 +120,39 @@ manage_package() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
checkPackageAndInstall()
|
|
||||||
{
|
checkPackageAndInstall() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
local isRequried="$2"
|
local isRequired="$2"
|
||||||
#проверяем установлени ли библиотека $name
|
local alt=""
|
||||||
if opkg list-installed | grep -q $name; then
|
|
||||||
echo "$name already installed..."
|
if [ "$name" = "https-dns-proxy" ]; then
|
||||||
|
alt="luci-app-doh-proxy"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$alt" ]; then
|
||||||
|
if opkg list-installed | grep -qE "^($name|$alt) "; then
|
||||||
|
echo "$name or $alt already installed..."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "$name not installed. Installed $name..."
|
if opkg list-installed | grep -q "^$name "; then
|
||||||
opkg install $name
|
echo "$name already installed..."
|
||||||
res=$?
|
return 0
|
||||||
if [ "$isRequried" = "1" ]; then
|
fi
|
||||||
if [ $res -eq 0 ]; then
|
fi
|
||||||
echo "$name insalled successfully"
|
|
||||||
else
|
echo "$name not installed. Installing $name..."
|
||||||
echo "Error installing $name. Please, install $name manually and run the script again"
|
opkg install "$name"
|
||||||
exit 1
|
res=$?
|
||||||
fi
|
|
||||||
fi
|
if [ "$isRequired" = "1" ]; then
|
||||||
|
if [ $res -eq 0 ]; then
|
||||||
|
echo "$name installed successfully"
|
||||||
|
else
|
||||||
|
echo "Error installing $name. Please, install $name manually$( [ -n "$alt" ] && echo " or $alt") and run the script again."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user