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