Skip to content

Commit 80a0b38

Browse files
author
bol-van
committed
install_easy: support dnf packager
1 parent e0e935c commit 80a0b38

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

common/installer.sh

+15-24
Original file line numberDiff line numberDiff line change
@@ -617,11 +617,17 @@ write_config_var()
617617
replace_var_def $1 "$M" "$ZAPRET_CONFIG"
618618
}
619619

620+
no_prereq_exit()
621+
{
622+
echo could not install prerequisites
623+
exitp 6
624+
}
620625
check_prerequisites_linux()
621626
{
622627
echo \* checking prerequisites
623628

624629
local s cmd PKGS UTILS req="curl curl"
630+
local APTGET DNF YUM PACMAN ZYPPER EOPKG APK
625631
case "$FWTYPE" in
626632
iptables)
627633
req="$req iptables iptables ip6tables iptables ipset ipset"
@@ -650,46 +656,31 @@ check_prerequisites_linux()
650656
echo packages required : $PKGS
651657

652658
APTGET=$(whichq apt-get)
659+
DNF=$(whichq dnf)
653660
YUM=$(whichq yum)
654661
PACMAN=$(whichq pacman)
655662
ZYPPER=$(whichq zypper)
656663
EOPKG=$(whichq eopkg)
657664
APK=$(whichq apk)
658665
if [ -x "$APTGET" ] ; then
659666
"$APTGET" update
660-
"$APTGET" install -y --no-install-recommends $PKGS dnsutils || {
661-
echo could not install prerequisites
662-
exitp 6
663-
}
667+
"$APTGET" install -y --no-install-recommends $PKGS dnsutils || no_prereq_exit
668+
elif [ -x "$DNF" ] ; then
669+
"$DNF" -y install $PKGS || no_prereq_exit
664670
elif [ -x "$YUM" ] ; then
665-
"$YUM" -y install $PKGS || {
666-
echo could not install prerequisites
667-
exitp 6
668-
}
671+
"$YUM" -y install $PKGS || no_prereq_exit
669672
elif [ -x "$PACMAN" ] ; then
670673
"$PACMAN" -Syy
671-
"$PACMAN" --noconfirm -S $PKGS || {
672-
echo could not install prerequisites
673-
exitp 6
674-
}
674+
"$PACMAN" --noconfirm -S $PKGS || no_prereq_exit
675675
elif [ -x "$ZYPPER" ] ; then
676-
"$ZYPPER" --non-interactive install $PKGS || {
677-
echo could not install prerequisites
678-
exitp 6
679-
}
676+
"$ZYPPER" --non-interactive install $PKGS || no_prereq_exit
680677
elif [ -x "$EOPKG" ] ; then
681-
"$EOPKG" -y install $PKGS || {
682-
echo could not install prerequisites
683-
exitp 6
684-
}
678+
"$EOPKG" -y install $PKGS || no_prereq_exit
685679
elif [ -x "$APK" ] ; then
686680
"$APK" update
687681
# for alpine
688682
[ "$FWTYPE" = iptables ] && [ -n "$($APK list ip6tables)" ] && PKGS="$PKGS ip6tables"
689-
"$APK" add $PKGS || {
690-
echo could not install prerequisites
691-
exitp 6
692-
}
683+
"$APK" add $PKGS || no_prereq_exit
693684
else
694685
echo supported package manager not found
695686
echo you must manually install : $UTILS

0 commit comments

Comments
 (0)