Modify init scripts if ${SHAREDIR} is non-standard

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-03-30 16:21:37 -07:00
parent 98f4a1c545
commit fead683f18
18 changed files with 74 additions and 108 deletions

View File

@ -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

View File

@ -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" ]

View File

@ -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 () {

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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
#

View File

@ -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" ]

View File

@ -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"

View File

@ -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

View File

@ -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,7 +324,8 @@ 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
fi

View File

@ -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 () {

View File

@ -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"

View File

@ -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

View File

@ -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" ]

View File

@ -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"

View File

@ -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