forked from evolix/evocheck
extract minifirewall_file function
This commit is contained in:
parent
5160d5a56c
commit
c93939c306
17
evocheck.sh
17
evocheck.sh
|
@ -106,6 +106,16 @@ is_installed(){
|
||||||
dpkg -l "$pkg" 2> /dev/null | grep -q -E '^(i|h)i' || return 1
|
dpkg -l "$pkg" 2> /dev/null | grep -q -E '^(i|h)i' || return 1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
minifirewall_file() {
|
||||||
|
case ${DEBIAN_RELEASE} in
|
||||||
|
lenny) "/etc/firewall.rc" ;;
|
||||||
|
squeeze) "/etc/firewall.rc" ;;
|
||||||
|
wheezy) "/etc/firewall.rc" ;;
|
||||||
|
jessie) "/etc/default/minifirewall" ;;
|
||||||
|
stretch) "/etc/default/minifirewall" ;;
|
||||||
|
*) "/etc/default/minifirewall" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
# logging
|
# logging
|
||||||
|
|
||||||
|
@ -1083,12 +1093,7 @@ main() {
|
||||||
#-----------------------------------------------------------
|
#-----------------------------------------------------------
|
||||||
|
|
||||||
if is_debian; then
|
if is_debian; then
|
||||||
|
MINIFW_FILE=$(minifirewall_file)
|
||||||
is_debian_lenny && MINIFW_FILE=/etc/firewall.rc
|
|
||||||
is_debian_squeeze && MINIFW_FILE=/etc/firewall.rc
|
|
||||||
is_debian_wheezy && MINIFW_FILE=/etc/firewall.rc
|
|
||||||
is_debian_jessie && MINIFW_FILE=/etc/default/minifirewall
|
|
||||||
is_debian_stretch && MINIFW_FILE=/etc/default/minifirewall
|
|
||||||
|
|
||||||
test "${IS_LSBRELEASE:=1}" = 1 && check_lsbrelease
|
test "${IS_LSBRELEASE:=1}" = 1 && check_lsbrelease
|
||||||
test "${IS_DPKGWARNING:=1}" = 1 && check_dpkgwarning
|
test "${IS_DPKGWARNING:=1}" = 1 && check_dpkgwarning
|
||||||
|
|
Loading…
Reference in a new issue