@@ -617,11 +617,17 @@ write_config_var()
617
617
replace_var_def $1 " $M " " $ZAPRET_CONFIG "
618
618
}
619
619
620
+ no_prereq_exit ()
621
+ {
622
+ echo could not install prerequisites
623
+ exitp 6
624
+ }
620
625
check_prerequisites_linux ()
621
626
{
622
627
echo \* checking prerequisites
623
628
624
629
local s cmd PKGS UTILS req=" curl curl"
630
+ local APTGET DNF YUM PACMAN ZYPPER EOPKG APK
625
631
case " $FWTYPE " in
626
632
iptables)
627
633
req=" $req iptables iptables ip6tables iptables ipset ipset"
@@ -650,46 +656,31 @@ check_prerequisites_linux()
650
656
echo packages required : $PKGS
651
657
652
658
APTGET=$( whichq apt-get)
659
+ DNF=$( whichq dnf)
653
660
YUM=$( whichq yum)
654
661
PACMAN=$( whichq pacman)
655
662
ZYPPER=$( whichq zypper)
656
663
EOPKG=$( whichq eopkg)
657
664
APK=$( whichq apk)
658
665
if [ -x " $APTGET " ] ; then
659
666
" $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
664
670
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
669
672
elif [ -x " $PACMAN " ] ; then
670
673
" $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
675
675
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
680
677
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
685
679
elif [ -x " $APK " ] ; then
686
680
" $APK " update
687
681
# for alpine
688
682
[ " $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
693
684
else
694
685
echo supported package manager not found
695
686
echo you must manually install : $UTILS
0 commit comments