From 37a3dbb6f64489965d9525374b7215a1fa4d2b38 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Thu, 23 Feb 2012 10:59:10 -0800 Subject: [PATCH] Don't install SysV init script if systemd is specified. Signed-off-by: Tom Eastep --- Shorewall-init/install.sh | 34 +++++++++++++++++-------------- Shorewall-lite/install.sh | 35 +++++++++++++++++--------------- Shorewall/install.sh | 42 ++++++++++++++++++++------------------- 3 files changed, 60 insertions(+), 51 deletions(-) diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 15a8f9037..c8a40aa35 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -216,9 +216,11 @@ fi if [ -z "$DESTDIR" ]; then if [ -f /lib/systemd/system ]; then SYSTEMD=Yes + INITFILE= fi elif [ -n "$SYSTEMD" ]; then mkdir -p ${DESTDIR}/lib/systemd/system + INITFILE= fi # @@ -237,22 +239,24 @@ else first_install="Yes" fi -# -# Install the Init Script -# -case $TARGET in - debian) - install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 - ;; - redhat) - install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 - ;; - *) - install_file init.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 - ;; -esac +if [ -n "$INITFILE" ]; then + # + # Install the Init Script + # + case $TARGET in + debian) + install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 + ;; + redhat) + install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 + ;; + *) + install_file init.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 + ;; + esac -echo "$Product script installed in ${DESTDIR}${INITDIR}/${INITFILE}" + echo "$Product script installed in ${DESTDIR}${INITDIR}/${INITFILE}" +fi # # Install the .service file # diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index c4cfb995f..93afb190b 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -240,6 +240,7 @@ if [ -n "$DESTDIR" ]; then if [ -n "$SYSTEMD" ]; then mkdir -p ${DESTDIR}/lib/systemd/system + INITFILE= fi else if [ ! -f /usr/share/shorewall/coreversion ]; then @@ -249,6 +250,7 @@ else if [ -f /lib/systemd/system ]; then SYSTEMD=Yes + INITFILE= fi fi @@ -305,23 +307,24 @@ if [ -n "$DESTDIR" ]; then chmod 755 ${DESTDIR}${INITDIR} fi -case $TARGET in - debian) - install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 - ;; - redhat) - install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 - ;; - archlinux) - install_file init.archlinux.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 - ;; - *) - install_file init.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 - ;; -esac - -echo "$Product script installed in ${DESTDIR}${INITDIR}/${INITFILE}" +if [ -n "$INITFILE" ]; then + case $TARGET in + debian) + install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 + ;; + redhat) + install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 + ;; + archlinux) + install_file init.archlinux.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 + ;; + *) + install_file init.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 + ;; + esac + echo "$Product init script installed in ${DESTDIR}${INITDIR}/${INITFILE}" +fi # # Install the .service file # diff --git a/Shorewall/install.sh b/Shorewall/install.sh index e843d20c4..fe7c0a97f 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -310,10 +310,12 @@ fi if [ -z "$DESTDIR" ]; then if [ -f /lib/systemd/system ]; then SYSTEMD=Yes + INITFILE= fi elif [ -n "$SYSTEMD" ]; then mkdir -p ${DESTDIR}/lib/systemd/system -fi + INITFILE= +fI echo "Installing $Product Version $VERSION" @@ -342,27 +344,27 @@ fi # # Install the Firewall Script # -case $HOST in - debian) - install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 - ;; - redhat) - install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 - ;; - slackware) - if [ $PRODUCT = shorewall ]; then - install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644 - install_file init.slackware.$PRODUCT.sh ${DESTDIR}${DEST}/rc.$PRODUCT 0644 - fi - ;; - *) - if [ -n "$INITFILE" ]; then +if [ -n "$INITFILE" ]; then + case $HOST in + debian) + install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 + ;; + redhat) + install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544 + ;; + slackware) + if [ $PRODUCT = shorewall ]; then + install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644 + install_file init.slackware.$PRODUCT.sh ${DESTDIR}${DEST}/rc.$PRODUCT 0644 + fi + ;; + *) install_file init.sh ${DESTDIR}${INITDIR}/$INITFILE 0544 - fi - ;; -esac + ;; + esac -[ -n "$INITFILE" ] && echo "$Product script installed in ${DESTDIR}${INITDIR}/$INITFILE" + echo "$Product script installed in ${DESTDIR}${INITDIR}/$INITFILE" +fi # # Create /etc/$PRODUCT and /var/lib/$PRODUCT if needed