2b846c7406
The lsb_release -si output might contain spaces. E.g. on openSUSE it is "openSUSE project". Change-Id: I0e37bab54d0156f484433246bba7cdc686326c86
31 lines
527 B
Bash
Executable File
31 lines
527 B
Bash
Executable File
#!/bin/bash
|
|
set -eu
|
|
|
|
OK=/opt/stack/gearman-iptables.ok
|
|
|
|
if [ -e $OK ] ; then
|
|
exit 0
|
|
fi
|
|
|
|
DISTRO=`lsb_release -si` || true
|
|
|
|
if [[ "Fedora" = "$DISTRO" ]]; then
|
|
|
|
# Check if the iptables service is active
|
|
if systemctl is-active iptables.service ; then
|
|
IPT_FILE=/etc/sysconfig/iptables
|
|
if [ -f $IPT_FILE ]; then
|
|
iptables-restore < $IPT_FILE
|
|
fi
|
|
|
|
# Gearman server
|
|
iptables -I INPUT -p tcp --dport 4730 -j ACCEPT
|
|
|
|
iptables-save > $IPT_FILE
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
touch $OK
|