mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Moved firewall commands from CentOS 7 to a routine and called form both CentOS 7 and Fedora. (#4366)
This commit is contained in:
parent
70efac8fa7
commit
dd7db0de93
18
snipeit.sh
18
snipeit.sh
|
@ -147,6 +147,14 @@ isdnfinstalled () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openfirewalld () {
|
||||||
|
if [ "$(firewall-cmd --state)" == "running" ]; then
|
||||||
|
echo "* Configuring firewall to allow HTTP traffic only."
|
||||||
|
log "firewall-cmd --zone=public --add-port=http/tcp --permanent"
|
||||||
|
log "firewall-cmd --reload"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [[ -f /etc/lsb-release || -f /etc/debian_version ]]; then
|
if [[ -f /etc/lsb-release || -f /etc/debian_version ]]; then
|
||||||
distro="$(lsb_release -s -i)"
|
distro="$(lsb_release -s -i)"
|
||||||
version="$(lsb_release -s -r)"
|
version="$(lsb_release -s -r)"
|
||||||
|
@ -539,11 +547,8 @@ case $distro in
|
||||||
|
|
||||||
installsnipeit
|
installsnipeit
|
||||||
|
|
||||||
if [ "$(firewall-cmd --state)" == "running" ]; then
|
#open the firewall for HTTP traffic only
|
||||||
echo "* Configuring firewall."
|
openfirewalld
|
||||||
log "firewall-cmd --zone=public --add-port=http/tcp --permanent"
|
|
||||||
log "firewall-cmd --reload"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Check if SELinux is enforcing
|
#Check if SELinux is enforcing
|
||||||
if [ "$(getenforce)" == "Enforcing" ]; then
|
if [ "$(getenforce)" == "Enforcing" ]; then
|
||||||
|
@ -602,6 +607,9 @@ case $distro in
|
||||||
|
|
||||||
installsnipeit
|
installsnipeit
|
||||||
|
|
||||||
|
#open the firewall for HTTP traffic only
|
||||||
|
openfirewalld
|
||||||
|
|
||||||
#Check if SELinux is enforcing
|
#Check if SELinux is enforcing
|
||||||
if [ "$(getenforce)" == "Enforcing" ]; then
|
if [ "$(getenforce)" == "Enforcing" ]; then
|
||||||
echo "* Configuring SELinux."
|
echo "* Configuring SELinux."
|
||||||
|
|
Loading…
Reference in a new issue