forked from extern/shorewall_code
Make PREFIX work under Cygwin - Take 2
This commit is contained in:
parent
eed9df1c06
commit
2d45a35c8f
@ -107,14 +107,6 @@ if [ -z "$RUNLEVELS" ] ; then
|
|||||||
RUNLEVELS=""
|
RUNLEVELS=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$OWNER" ] ; then
|
|
||||||
OWNER=root
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$GROUP" ] ; then
|
|
||||||
GROUP=root
|
|
||||||
fi
|
|
||||||
|
|
||||||
while [ $# -gt 0 ] ; do
|
while [ $# -gt 0 ] ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h|help|?)
|
-h|help|?)
|
||||||
@ -138,17 +130,34 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
|||||||
# Determine where to install the firewall script
|
# Determine where to install the firewall script
|
||||||
#
|
#
|
||||||
DEBIAN=
|
DEBIAN=
|
||||||
|
CYGWIN=
|
||||||
|
|
||||||
|
case $(uname) in
|
||||||
|
CYGWIN*)
|
||||||
|
if [ -z "$PREFIX" ]; then
|
||||||
|
DEST=
|
||||||
|
INIT=
|
||||||
|
fi
|
||||||
|
|
||||||
|
OWNER=$(id -un)
|
||||||
|
GROUP=$(id -gn)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
[ -z "$OWNER" ] && OWNER=root
|
||||||
|
[ -z "$GROUP" ] && GROUP=root
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
OWNERSHIP="-o $OWNER -g $GROUP"
|
OWNERSHIP="-o $OWNER -g $GROUP"
|
||||||
|
|
||||||
if [ -n "$PREFIX" ]; then
|
if [ -n "$PREFIX" ]; then
|
||||||
if [ `id -u` != 0 ] ; then
|
if [ `id -u` != 0 ] ; then
|
||||||
echo "Not setting file owner/group permissions, not running as root."
|
echo "Not setting file owner/group permissions, not running as root."
|
||||||
OWNERSHIP=""
|
OWNERSHIP=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin
|
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin
|
||||||
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
|
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
|
||||||
elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
|
elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
|
||||||
DEBIAN=yes
|
DEBIAN=yes
|
||||||
elif [ -f /etc/slackware-version ] ; then
|
elif [ -f /etc/slackware-version ] ; then
|
||||||
|
@ -113,8 +113,11 @@ MANDIR=${MANDIR:-"/usr/share/man"}
|
|||||||
|
|
||||||
case $(uname) in
|
case $(uname) in
|
||||||
CYGWIN*)
|
CYGWIN*)
|
||||||
DEST=
|
if [ -z "$PREFIX" ]; then
|
||||||
INIT=
|
DEST=
|
||||||
|
INIT=
|
||||||
|
fi
|
||||||
|
|
||||||
OWNER=$(id -un)
|
OWNER=$(id -un)
|
||||||
GROUP=$(id -gn)
|
GROUP=$(id -gn)
|
||||||
CYGWIN=Yes
|
CYGWIN=Yes
|
||||||
|
@ -133,8 +133,11 @@ DEBIAN=
|
|||||||
|
|
||||||
case $(uname) in
|
case $(uname) in
|
||||||
CYGWIN*)
|
CYGWIN*)
|
||||||
DEST=
|
if [ -z "$PREFIX" ]; then
|
||||||
INIT=
|
DEST=
|
||||||
|
INIT=
|
||||||
|
fi
|
||||||
|
|
||||||
OWNER=$(id -un)
|
OWNER=$(id -un)
|
||||||
GROUP=$(id -gn)
|
GROUP=$(id -gn)
|
||||||
;;
|
;;
|
||||||
|
@ -113,8 +113,11 @@ MANDIR=${MANDIR:-"/usr/share/man"}
|
|||||||
|
|
||||||
case $(uname) in
|
case $(uname) in
|
||||||
CYGWIN*)
|
CYGWIN*)
|
||||||
DEST=
|
if [ -z "$PREFIX" ]; then
|
||||||
INIT=
|
DEST=
|
||||||
|
INIT=
|
||||||
|
fi
|
||||||
|
|
||||||
OWNER=$(id -un)
|
OWNER=$(id -un)
|
||||||
GROUP=$(id -gn)
|
GROUP=$(id -gn)
|
||||||
CYGWIN=Yes
|
CYGWIN=Yes
|
||||||
|
Loading…
Reference in New Issue
Block a user