forked from extern/shorewall_code
Modify init scripts if ${SHAREDIR} is non-standard
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
98f4a1c545
commit
fead683f18
@ -71,6 +71,11 @@ Debian_SuSE_ppp() {
|
|||||||
IFUPDOWN=0
|
IFUPDOWN=0
|
||||||
PRODUCTS=
|
PRODUCTS=
|
||||||
|
|
||||||
|
#
|
||||||
|
# The installer may alter this
|
||||||
|
#
|
||||||
|
. /usr/share/shorewall/shorewallrc
|
||||||
|
|
||||||
if [ -f /etc/default/shorewall-init ]; then
|
if [ -f /etc/default/shorewall-init ]; then
|
||||||
. /etc/default/shorewall-init
|
. /etc/default/shorewall-init
|
||||||
elif [ -f /etc/sysconfig/shorewall-init ]; then
|
elif [ -f /etc/sysconfig/shorewall-init ]; then
|
||||||
|
@ -62,14 +62,10 @@ not_configured () {
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#determine where the files were installed
|
#
|
||||||
if [ -f ~/.shorewallrc ]; then
|
# The installer may alter this
|
||||||
. ~/.shorewallrc || exit 1
|
#
|
||||||
SRWL=${SBIN}/shorewall-init
|
. /usr/share/shorewall/shorewallrc
|
||||||
else
|
|
||||||
CONFDIR=/etc
|
|
||||||
SYSCONFDIR=/etc/default
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check if shorewall-init is configured or not
|
# check if shorewall-init is configured or not
|
||||||
if [ -f "$SYSCONFDIR/shorewall-init" ]
|
if [ -f "$SYSCONFDIR/shorewall-init" ]
|
||||||
|
@ -53,11 +53,10 @@ else
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ~/.shorewallrc ]; then
|
#
|
||||||
. ~/.shorewallrc || exit 1
|
# The installer may alter this
|
||||||
else
|
#
|
||||||
VARDIR=/var/lib
|
. /usr/share/shorewall/shorewallrc
|
||||||
fi
|
|
||||||
|
|
||||||
# Initialize the firewall
|
# Initialize the firewall
|
||||||
shorewall_start () {
|
shorewall_start () {
|
||||||
|
@ -262,6 +262,7 @@ fi
|
|||||||
#
|
#
|
||||||
if [ -n "$INITFILE" ]; then
|
if [ -n "$INITFILE" ]; then
|
||||||
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544
|
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544
|
||||||
|
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}${INITDIR}/$INITFILE
|
||||||
|
|
||||||
if [ -n "${AUXINITSOURCE}" ]; then
|
if [ -n "${AUXINITSOURCE}" ]; then
|
||||||
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$AUXINITFILE 0544
|
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$AUXINITFILE 0544
|
||||||
|
@ -57,14 +57,10 @@ not_configured () {
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#determine where the files were installed
|
#
|
||||||
if [ -f ~/.shorewallrc ]; then
|
# The installer may alter this
|
||||||
. ~/.shorewallrc || exit 1
|
#
|
||||||
SRWL=${SBIN}/shorewall-lite
|
. /usr/share/shorewall/shorewallrc
|
||||||
else
|
|
||||||
CONFDIR=/etc
|
|
||||||
SYSCONFDIR=/etc/default
|
|
||||||
fi
|
|
||||||
|
|
||||||
# parse the shorewall params file in order to use params in
|
# parse the shorewall params file in order to use params in
|
||||||
# /etc/default/shorewall
|
# /etc/default/shorewall
|
||||||
|
@ -20,13 +20,10 @@
|
|||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
#determine where the files were installed
|
#
|
||||||
if [ -f ~/.shorewallrc ]; then
|
# The installer may alter this
|
||||||
. ~/.shorewallrc || exit 1
|
#
|
||||||
else
|
. /usr/share/shorewall/shorewallrc
|
||||||
SBINDIR=/sbin
|
|
||||||
SYSCONFDIR=/etc/default
|
|
||||||
fi
|
|
||||||
|
|
||||||
prog="shorewall-lite"
|
prog="shorewall-lite"
|
||||||
shorewall="${SBINDIR}/$prog"
|
shorewall="${SBINDIR}/$prog"
|
||||||
|
@ -62,12 +62,10 @@ usage() {
|
|||||||
################################################################################
|
################################################################################
|
||||||
OPTIONS=
|
OPTIONS=
|
||||||
|
|
||||||
if [ ~/.shorewallrc ]; then
|
#
|
||||||
. ~/.shorewallrc || exit 1
|
# The installer may alter this
|
||||||
else
|
#
|
||||||
SBINDIR=/sbin
|
. /usr/share/shorewall/shorewallrc
|
||||||
SYSCONFDIR=/etc/sysconfig
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ${SYSCONFDIR}/shorewall-lite ]; then
|
if [ -f ${SYSCONFDIR}/shorewall-lite ]; then
|
||||||
. ${SYSCONFDIR}/shorewall-lite
|
. ${SYSCONFDIR}/shorewall-lite
|
||||||
|
@ -339,21 +339,26 @@ if [ -n "$DESTDIR" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$INITFILE" ]; then
|
if [ -n "$INITFILE" ]; then
|
||||||
|
|
||||||
|
initfile="${DESTDIR}/${INITDIR}/${INITFILE}"
|
||||||
|
|
||||||
case $TARGET in
|
case $TARGET in
|
||||||
debian)
|
debian)
|
||||||
install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
install_file init.debian.sh "$initfile" 0544
|
||||||
;;
|
;;
|
||||||
redhat)
|
redhat)
|
||||||
install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
install_file init.fedora.sh "$initfile" 0544
|
||||||
;;
|
;;
|
||||||
archlinux)
|
archlinux)
|
||||||
install_file init.archlinux.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
install_file init.archlinux.sh "$initfile" 0544
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
install_file init.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
install_file init.sh "$initfile" 0544
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
[ "${SHAREDIR} = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' "$initfile"
|
||||||
|
|
||||||
echo "$Product init script installed in ${DESTDIR}${INITDIR}/${INITFILE}"
|
echo "$Product init script installed in ${DESTDIR}${INITDIR}/${INITFILE}"
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
@ -53,13 +53,10 @@ not_configured () {
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#determine where the files were installed
|
#
|
||||||
if [ -f ~/.shorewallrc ]; then
|
# The installer may alter this
|
||||||
. ~/.shorewallrc || exit 1
|
#
|
||||||
SRWL=${SBIN}/shorewall
|
. /usr/share/shorewall/shorewallrc
|
||||||
else
|
|
||||||
SYSCONFDIR=/etc/default
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check if shorewall is configured or not
|
# check if shorewall is configured or not
|
||||||
if [ -f "${SYSCONFDIR}/shorewall" ]
|
if [ -f "${SYSCONFDIR}/shorewall" ]
|
||||||
|
@ -20,13 +20,10 @@
|
|||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
#determine where the files were installed
|
#
|
||||||
if [ -f ~/.shorewallrc ]; then
|
# The installer may alter this
|
||||||
. ~/.shorewallrc || exit 1
|
#
|
||||||
else
|
. /usr/share/shorewall/shorewallrc
|
||||||
SBINDIR=/sbin
|
|
||||||
SYSCONFDIR=/etc/default
|
|
||||||
fi
|
|
||||||
|
|
||||||
prog="shorewall"
|
prog="shorewall"
|
||||||
shorewall="${SBINDIR}/$prog"
|
shorewall="${SBINDIR}/$prog"
|
||||||
|
@ -63,12 +63,10 @@ usage() {
|
|||||||
################################################################################
|
################################################################################
|
||||||
OPTIONS="-v0"
|
OPTIONS="-v0"
|
||||||
|
|
||||||
if [ ~/.shorewallrc ]; then
|
#
|
||||||
. ~/.shorewallrc || exit 1
|
# The installer may alter this
|
||||||
else
|
#
|
||||||
SBINDIR=/sbin
|
. /usr/share/shorewall/shorewallrc
|
||||||
SYSCONFDIR=/etc/sysconfig
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ${SYSCONFDIR}/shorewall ]; then
|
if [ -f ${SYSCONFDIR}/shorewall ]; then
|
||||||
. ${SYSCONFDIR}/shorewall
|
. ${SYSCONFDIR}/shorewall
|
||||||
|
@ -295,7 +295,6 @@ fi
|
|||||||
|
|
||||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${SBINDIR}
|
install -d $OWNERSHIP -m 755 ${DESTDIR}${SBINDIR}
|
||||||
[ -n "${INITFILE}" ] && install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
|
[ -n "${INITFILE}" ] && install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
|
||||||
|
|
||||||
if [ -z "$DESTDIR" -a $PRODUCT != shorewall ]; then
|
if [ -z "$DESTDIR" -a $PRODUCT != shorewall ]; then
|
||||||
[ -x ${LIBEXECDIR}/shorewall/compiler.pl ] || \
|
[ -x ${LIBEXECDIR}/shorewall/compiler.pl ] || \
|
||||||
{ echo " ERROR: Shorewall >= 4.5.0 is not installed" >&2; exit 1; }
|
{ echo " ERROR: Shorewall >= 4.5.0 is not installed" >&2; exit 1; }
|
||||||
@ -325,6 +324,7 @@ echo "$PRODUCT control program installed in ${DESTDIR}${SBINDIR}/$PRODUCT"
|
|||||||
#
|
#
|
||||||
if [ -n "$INITFILE" ]; then
|
if [ -n "$INITFILE" ]; then
|
||||||
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544
|
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544
|
||||||
|
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}${INITDIR}/$INITFILE
|
||||||
|
|
||||||
if [ -n "${AUXINITSOURCE}" ]; then
|
if [ -n "${AUXINITSOURCE}" ]; then
|
||||||
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544
|
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544
|
||||||
|
@ -78,11 +78,10 @@ else
|
|||||||
not_configured
|
not_configured
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#determine where the files were installed
|
#
|
||||||
if [ -f ~/.shorewallrc ]; then
|
# The installer may alter this
|
||||||
. ~/.shorewallrc || exit 1
|
#
|
||||||
[ -n "$SBIN" ] && SRWL=${SBIN}/shorewall6-lite
|
. /usr/share/shorewall/shorewallrc
|
||||||
fi
|
|
||||||
|
|
||||||
# start the firewall
|
# start the firewall
|
||||||
shorewall6_start () {
|
shorewall6_start () {
|
||||||
|
@ -20,13 +20,10 @@
|
|||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
#determine where the files were installed
|
#
|
||||||
if [ -f ~/.shorewallrc ]; then
|
# The installer may alter this
|
||||||
. ~/.shorewallrc || exit 1
|
#
|
||||||
else
|
. /usr/share/shorewall/shorewallrc
|
||||||
SBINDIR=/sbin
|
|
||||||
SYSCONFDIR=/etc/default
|
|
||||||
fi
|
|
||||||
|
|
||||||
prog="shorewall6-lite"
|
prog="shorewall6-lite"
|
||||||
shorewall="${SBINDIR}/$prog"
|
shorewall="${SBINDIR}/$prog"
|
||||||
|
@ -62,16 +62,10 @@ usage() {
|
|||||||
################################################################################
|
################################################################################
|
||||||
OPTIONS=
|
OPTIONS=
|
||||||
|
|
||||||
if [ ~/.shorewallrc ]; then
|
#
|
||||||
. ~/.shorewallrc || exit 1
|
# The installer may alter this
|
||||||
else
|
#
|
||||||
SBINDIR=/sbin
|
. /usr/share/shorewall/shorewallrc
|
||||||
SYSCONFDIR=/etc/sysconfig
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ${SYSCONFDIR}/shorewall6-lite ]; then
|
|
||||||
. ${SYSCONFDIR}/shorewall6-lite
|
|
||||||
fi
|
|
||||||
|
|
||||||
export SHOREWALL_INIT_SCRIPT=1
|
export SHOREWALL_INIT_SCRIPT=1
|
||||||
|
|
||||||
|
@ -54,13 +54,10 @@ not_configured () {
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#determine where the files were installed
|
#
|
||||||
if [ -f ~/.shorewallrc ]; then
|
# The installer may alter this
|
||||||
. ~/.shorewallrc || exit 1
|
#
|
||||||
[ -n "$SBIN" ] && SRWL=${SBIN}/shorewall6
|
. /usr/share/shorewall/shorewallrc
|
||||||
else
|
|
||||||
SYSCONFDIR=/etc/default
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check if shorewall is configured or not
|
# check if shorewall is configured or not
|
||||||
if [ -f "${SYSCONFDIR}/shorewall6" ]
|
if [ -f "${SYSCONFDIR}/shorewall6" ]
|
||||||
|
@ -20,13 +20,11 @@
|
|||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
#determine where the files were installed
|
#
|
||||||
if [ -f ~/.shorewallrc ]; then
|
# The installer may alter this
|
||||||
. ~/.shorewallrc || exit 1
|
#
|
||||||
else
|
. /usr/share/shorewall/shorewallrc
|
||||||
SBINDIR=/sbin
|
|
||||||
SYSCONFDIR=/etc/default
|
|
||||||
fi
|
|
||||||
prog="shorewall6"
|
prog="shorewall6"
|
||||||
shorewall="${SBINDIR}/$prog"
|
shorewall="${SBINDIR}/$prog"
|
||||||
logger="logger -i -t $prog"
|
logger="logger -i -t $prog"
|
||||||
|
@ -63,18 +63,10 @@ usage() {
|
|||||||
################################################################################
|
################################################################################
|
||||||
OPTIONS="-v0"
|
OPTIONS="-v0"
|
||||||
|
|
||||||
if [ ~/.shorewallrc ]; then
|
#
|
||||||
. ~/.shorewallrc || exit 1
|
# The installer may alter this
|
||||||
else
|
#
|
||||||
SBINDIR=/sbin
|
. /usr/share/shorewall/shorewallrc
|
||||||
SYSCONFDIR=/etc/sysconfig
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/sysconfig/shorewall6 ]; then
|
|
||||||
. /etc/sysconfig/shorewall6
|
|
||||||
elif [ -f /etc/default/shorewall6 ] ; then
|
|
||||||
. /etc/default/shorewall6
|
|
||||||
fi
|
|
||||||
|
|
||||||
export SHOREWALL_INIT_SCRIPT=1
|
export SHOREWALL_INIT_SCRIPT=1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user