From af3958f36933974bc75b01734641212facb656a2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 28 Oct 2021 14:41:40 -0400 Subject: [PATCH] Better test when removing firewalld service files --- .../xcat/netboot/rh/compute.rhels8.ppc64le.postinstall | 10 ++++++---- .../xcat/netboot/rh/compute.rhels8.x86_64.postinstall | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.postinstall index 545ec8435..dd2576c8f 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.postinstall @@ -42,13 +42,15 @@ fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys -if [ -f "$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" ] +FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" +if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] then - rm -rf $installroot/etc/systemd/system/multi-user.target.wants/firewalld.service + rm -f $FIREWALLD fi -if [ -f "$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" ] +FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" +if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] then - rm -rf $installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service + rm -f $FIREWALLD1 fi diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.postinstall index e6728e1a7..2ad53bb40 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.postinstall @@ -41,13 +41,15 @@ then fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys -if [ -f "$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" ] +FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" +if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] then - rm -rf $installroot/etc/systemd/system/multi-user.target.wants/firewalld.service + rm -f $FIREWALLD fi -if [ -f "$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" ] +FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" +if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] then - rm -rf $installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service + rm -f $FIREWALLD1 fi