Compare commits

..

1 Commits

View File

@ -617,17 +617,11 @@ write_config_var()
replace_var_def $1 "$M" "$ZAPRET_CONFIG" replace_var_def $1 "$M" "$ZAPRET_CONFIG"
} }
no_prereq_exit()
{
echo could not install prerequisites
exitp 6
}
check_prerequisites_linux() check_prerequisites_linux()
{ {
echo \* checking prerequisites echo \* checking prerequisites
local s cmd PKGS UTILS req="curl curl" local s cmd PKGS UTILS req="curl curl"
local APTGET DNF YUM PACMAN ZYPPER EOPKG APK
case "$FWTYPE" in case "$FWTYPE" in
iptables) iptables)
req="$req iptables iptables ip6tables iptables ipset ipset" req="$req iptables iptables ip6tables iptables ipset ipset"
@ -656,7 +650,6 @@ check_prerequisites_linux()
echo packages required : $PKGS echo packages required : $PKGS
APTGET=$(whichq apt-get) APTGET=$(whichq apt-get)
DNF=$(whichq dnf)
YUM=$(whichq yum) YUM=$(whichq yum)
PACMAN=$(whichq pacman) PACMAN=$(whichq pacman)
ZYPPER=$(whichq zypper) ZYPPER=$(whichq zypper)
@ -664,23 +657,39 @@ check_prerequisites_linux()
APK=$(whichq apk) APK=$(whichq apk)
if [ -x "$APTGET" ] ; then if [ -x "$APTGET" ] ; then
"$APTGET" update "$APTGET" update
"$APTGET" install -y --no-install-recommends $PKGS dnsutils || no_prereq_exit "$APTGET" install -y --no-install-recommends $PKGS dnsutils || {
elif [ -x "$DNF" ] ; then echo could not install prerequisites
"$DNF" -y install $PKGS || no_prereq_exit exitp 6
}
elif [ -x "$YUM" ] ; then elif [ -x "$YUM" ] ; then
"$YUM" -y install $PKGS || no_prereq_exit "$YUM" -y install $PKGS || {
echo could not install prerequisites
exitp 6
}
elif [ -x "$PACMAN" ] ; then elif [ -x "$PACMAN" ] ; then
"$PACMAN" -Syy "$PACMAN" -Syy
"$PACMAN" --noconfirm -S $PKGS || no_prereq_exit "$PACMAN" --noconfirm -S $PKGS || {
echo could not install prerequisites
exitp 6
}
elif [ -x "$ZYPPER" ] ; then elif [ -x "$ZYPPER" ] ; then
"$ZYPPER" --non-interactive install $PKGS || no_prereq_exit "$ZYPPER" --non-interactive install $PKGS || {
echo could not install prerequisites
exitp 6
}
elif [ -x "$EOPKG" ] ; then elif [ -x "$EOPKG" ] ; then
"$EOPKG" -y install $PKGS || no_prereq_exit "$EOPKG" -y install $PKGS || {
echo could not install prerequisites
exitp 6
}
elif [ -x "$APK" ] ; then elif [ -x "$APK" ] ; then
"$APK" update "$APK" update
# for alpine # for alpine
[ "$FWTYPE" = iptables ] && [ -n "$($APK list ip6tables)" ] && PKGS="$PKGS ip6tables" [ "$FWTYPE" = iptables ] && [ -n "$($APK list ip6tables)" ] && PKGS="$PKGS ip6tables"
"$APK" add $PKGS || no_prereq_exit "$APK" add $PKGS || {
echo could not install prerequisites
exitp 6
}
else else
echo supported package manager not found echo supported package manager not found
echo you must manually install : $UTILS echo you must manually install : $UTILS