diff --git a/Shorewall-core/configure b/Shorewall-core/configure index 8efeea73c..8320c23f4 100755 --- a/Shorewall-core/configure +++ b/Shorewall-core/configure @@ -94,6 +94,29 @@ done vendor=${params[HOST]} if [ -z "$vendor" ]; then + if [ -f /etc/os-release ]; then + eval $(cat /etc/os-release | grep ^ID) + + case $ID in + fedora) + vendor=redhat + ;; + debian) + vendor=debian + ;; + opensuse) + vendor=suse + ;; + *) + vendor="$ID" + ;; + esac + + $params[HOST]=" + fi +fi + +if [ -z "vendor" ]; then case `uname` in Darwin) $params[HOST]=apple diff --git a/Shorewall-core/configure.pl b/Shorewall-core/configure.pl index f2b213c3a..04159b6d2 100755 --- a/Shorewall-core/configure.pl +++ b/Shorewall-core/configure.pl @@ -56,6 +56,26 @@ my $vendor = $params{HOST}; my $rcfile; my $rcfilename; +unless ( defined $vendor ) { + if ( -f /etc/os-release) { + my $id = `cat /etc/os-release | grep ^ID`; + + chomp $id; + + $id =~ s/ID=//; + + if ( $id eq 'fedora' ) { + $vendor = 'redhat'; + } elsif ( $id eq 'opensuse' ) { + $vendor = 'suse'; + } else { + $vendor = $id; + } + } + + $params{HOST} = $vendor; +} + if ( defined $vendor ) { $rcfilename = $vendor eq 'linux' ? 'shorewallrc.default' : 'shorewallrc.' . $vendor; die qq("ERROR: $vendor" is not a recognized host type) unless -f $rcfilename; diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh index 9f9790959..8c6b442f0 100755 --- a/Shorewall-core/install.sh +++ b/Shorewall-core/install.sh @@ -194,7 +194,24 @@ if [ -z "$BUILD" ]; then BUILD=apple ;; *) - if [ -f /etc/debian_version ]; then + if [ -f /etc/os-release ]; then + eval $(cat /etc/os-release | grep ^ID) + + case $ID in + fedora) + BUILD=redhat + ;; + debian) + BUILD=debian + ;; + opensuse) + BUILD=suse + ;; + *) + BUILD="$ID" + ;; + esac + elif [ -f /etc/debian_version ]; then BUILD=debian elif [ -f /etc/redhat-release ]; then BUILD=redhat diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 60e4a5415..60baebdd9 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -182,7 +182,24 @@ if [ -z "$BUILD" ]; then BUILD=apple ;; *) - if [ -f /etc/debian_version ]; then + if [ -f /etc/os-release ]; then + eval $(cat /etc/os-release | grep ^ID) + + case $ID in + fedora) + BUILD=redhat + ;; + debian) + BUILD=debian + ;; + opensuse) + BUILD=suse + ;; + *) + BUILD="$ID" + ;; + esac + elif [ -f /etc/debian_version ]; then BUILD=debian elif [ -f /etc/redhat-release ]; then BUILD=redhat @@ -222,7 +239,7 @@ case "$HOST" in debian) echo "Installing Debian-specific configuration..." ;; - redhat|redhat) + redhat) echo "Installing Redhat/Fedora-specific configuration..." ;; slackware) @@ -233,7 +250,7 @@ case "$HOST" in echo "Shorewall-init is currently not supported on Arch Linux" >&2 exit 1 ;; - suse|suse) + suse) echo "Installing SuSE-specific configuration..." ;; linux) diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index fcc259683..e45561234 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -200,7 +200,24 @@ if [ -z "$BUILD" ]; then BUILD=apple ;; *) - if [ -f ${CONFDIR}/debian_version ]; then + if [ -f /etc/os-release ]; then + eval $(cat /etc/os-release | grep ^ID) + + case $ID in + fedora) + BUILD=redhat + ;; + debian) + BUILD=debian + ;; + opensuse) + BUILD=suse + ;; + *) + BUILD="$ID" + ;; + esac + elif [ -f ${CONFDIR}/debian_version ]; then BUILD=debian elif [ -f ${CONFDIR}/redhat-release ]; then BUILD=redhat diff --git a/Shorewall/install.sh b/Shorewall/install.sh index 64a0b4d18..9ee46cf32 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -212,7 +212,24 @@ if [ -z "$BUILD" ]; then BUILD=apple ;; *) - if [ -f /etc/debian_version ]; then + if [ -f /etc/os-release ]; then + eval $(cat /etc/os-release | grep ^ID) + + case $ID in + fedora) + BUILD=redhat + ;; + debian) + BUILD=debian + ;; + opensuse) + BUILD=suse + ;; + *) + BUILD="$ID" + ;; + esac + elif [ -f /etc/debian_version ]; then BUILD=debian elif [ -f /etc/redhat-release ]; then BUILD=redhat