From f13d58718d11f3532773a2b7ae786d0b4647bb26 Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 12 Nov 2006 16:00:38 +0000 Subject: [PATCH] Fix install scripts to work with PREFIX on Slackware and Arch Linux git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4854 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-lite/install.sh | 20 +++++++++++--------- Shorewall/install.sh | 20 +++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index a43fcd255..3198597d3 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -187,15 +187,7 @@ DEBIAN= OWNERSHIP="-o $OWNER -g $GROUP" -if [ -n "$PREFIX" ]; then - if [ `id -u` != 0 ] ; then - echo "Not setting file owner/group permissions, not running as root." - OWNERSHIP="" - fi - - install -d $OWNERSHIP -m 755 ${PREFIX}/sbin - install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} -elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then +if [ -d /etc/apt -a -e /usr/bin/dpkg ]; then DEBIAN=yes elif [ -f /etc/slackware-version ] ; then DEST="/etc/rc.d" @@ -206,6 +198,16 @@ elif [ -f /etc/arch-release ] ; then ARCHLINUX=yes fi +if [ -n "$PREFIX" ]; then + if [ `id -u` != 0 ] ; then + echo "Not setting file owner/group permissions, not running as root." + OWNERSHIP="" + fi + + install -d $OWNERSHIP -m 755 ${PREFIX}/sbin + install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} +fi + # # Change to the directory containing this script # diff --git a/Shorewall/install.sh b/Shorewall/install.sh index 58327c1bd..cd784861c 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -187,15 +187,7 @@ DEBIAN= OWNERSHIP="-o $OWNER -g $GROUP" -if [ -n "$PREFIX" ]; then - if [ `id -u` != 0 ] ; then - echo "Not setting file owner/group permissions, not running as root." - OWNERSHIP="" - fi - - install -d $OWNERSHIP -m 755 ${PREFIX}/sbin - install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} -elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then +if [ -d /etc/apt -a -e /usr/bin/dpkg ]; then DEBIAN=yes elif [ -f /etc/slackware-version ] ; then DEST="/etc/rc.d" @@ -206,6 +198,16 @@ elif [ -f /etc/arch-release ] ; then ARCHLINUX=yes fi +if [ -n "$PREFIX" ]; then + if [ `id -u` != 0 ] ; then + echo "Not setting file owner/group permissions, not running as root." + OWNERSHIP="" + fi + + install -d $OWNERSHIP -m 755 ${PREFIX}/sbin + install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} +fi + # # Change to the directory containing this script #