Add wait4ifup

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5180 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-01-01 00:40:42 +00:00
parent 2ed244a7e8
commit a0b42400a3
8 changed files with 64 additions and 1 deletions

View File

@ -311,6 +311,15 @@ install_file shorecap ${PREFIX}/usr/share/shorewall-lite/shorecap 0555
echo echo
echo "Capability file builder installed in ${PREFIX}/usr/share/shorewall-lite/shorecap" echo "Capability file builder installed in ${PREFIX}/usr/share/shorewall-lite/shorecap"
#
# Install wait4ifup
#
install_file wait4ifup ${PREFIX}/usr/share/shorewall-lite/wait4ifup 0555
echo
echo "wait4ifup installed in ${PREFIX}/usr/share/shorewall-lite/wait4ifup"
# #
# Install the Modules file # Install the Modules file
# #

View File

@ -80,6 +80,7 @@ fi
%attr(0444,root,root) /usr/share/shorewall-lite/lib.cli %attr(0444,root,root) /usr/share/shorewall-lite/lib.cli
%attr(0444,root,root) /usr/share/shorewall-lite/modules %attr(0444,root,root) /usr/share/shorewall-lite/modules
%attr(0544,root,root) /usr/share/shorewall-lite/shorecap %attr(0544,root,root) /usr/share/shorewall-lite/shorecap
%attr(0555,root,root) /usr/share/shorewall-lite/wait4ifup
%attr(0444,root,root) %{_mandir}/man5/shorewall-accounting.5.gz %attr(0444,root,root) %{_mandir}/man5/shorewall-accounting.5.gz
%attr(0444,root,root) %{_mandir}/man5/shorewall-actions.5.gz %attr(0444,root,root) %{_mandir}/man5/shorewall-actions.5.gz

View File

@ -2,7 +2,10 @@ Changes in 3.4.0 Beta 2
1) Fix for empty blacklist file. 1) Fix for empty blacklist file.
2) Don't copy files from /usr/share/shorewall into the compiled script. 2) Don't copy files from /usr/share/shorewall into the compiled
script.
3) Add wait4ifup.
Changes in 3.4.0 Beta 1 Changes in 3.4.0 Beta 1

View File

@ -291,6 +291,15 @@ install_file compiler ${PREFIX}/usr/share/shorewall/compiler 0555
echo echo
echo "Compiler installed in ${PREFIX}/usr/share/shorewall/compiler" echo "Compiler installed in ${PREFIX}/usr/share/shorewall/compiler"
#
# Install wait4ifup
#
install_file wait4ifup ${PREFIX}/usr/share/shorewall/wait4ifup 0555
echo
echo "wait4ifup installed in ${PREFIX}/usr/share/shorewall/wait4ifup"
# #
# Install the policy file # Install the policy file
# #

View File

@ -619,6 +619,15 @@ New Features in Shorewall 3.4:
causes the resulting rule to be inserted into the POSTROUTING causes the resulting rule to be inserted into the POSTROUTING
chain. chain.
28) The program /usr/share/shorewall/wait4ifup can be used to wait for
a network device (such as a ppp device) to reach the UP state.
/usr/share/shorewall/wait4ifup <interface> [ <seconds> ]
The program will wait for up to <seconds> seconds for the
named <interface> to reach the UP state. if <seconds> is not given,
60 seconds is assumed.
Problems Corrected in 3.4.0 Beta 1. Problems Corrected in 3.4.0 Beta 1.
1) It is now possible to place entries in the IPSEC column of 1) It is now possible to place entries in the IPSEC column of

View File

@ -190,6 +190,7 @@ fi
%attr(0644,root,root) /usr/share/shorewall/prog.header %attr(0644,root,root) /usr/share/shorewall/prog.header
%attr(0644,root,root) /usr/share/shorewall/rfc1918 %attr(0644,root,root) /usr/share/shorewall/rfc1918
%attr(0644,root,root) /usr/share/shorewall/configpath %attr(0644,root,root) /usr/share/shorewall/configpath
%attr(0555,root,root) /usr/share/shorewall/wait4ifup
%attr(0644,root,root) /usr/share/shorewall/configfiles/shorewall.conf %attr(0644,root,root) /usr/share/shorewall/configfiles/shorewall.conf
%attr(0644,root,root) /usr/share/shorewall/configfiles/zones %attr(0644,root,root) /usr/share/shorewall/configfiles/zones

28
Shorewall/wait4ifup Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
#
# Determine if Interface is up
#
interface_is_up() {
[ -n "$(ip link ls dev $1 | grep -e '[<,]UP[,>]')" ]
}
case $# in
1)
timeout=60
;;
2)
timeout=$2
;;
*)
echo "usage: $(basename $0) <interface> [ <timeout> ]"
exit 2
;;
esac
while [ $timeout -gt 0 ] && ! interface_is_up $1; do
sleep 1
timeout=$(( $timeout - 1 ))
done

View File

@ -317,6 +317,9 @@ if [ -n "${BUILDTARBALL}${BUILDRPM}" ]; then
if [ -f $SHOREWALLDIR/lib.cli ]; then if [ -f $SHOREWALLDIR/lib.cli ]; then
do_or_die "cp $SHOREWALLDIR/lib.cli $SHOREWALLLITEDIR >> $LOGFILE 2>&1" do_or_die "cp $SHOREWALLDIR/lib.cli $SHOREWALLLITEDIR >> $LOGFILE 2>&1"
fi fi
if [ -f $SHOREWALLDIR/wait4ifup ]; then
do_or_die "cp $SHOREWALLDIR/wait4ifup $SHOREWALLLITEDIR >> $LOGFILE 2>&1"
fi
else else
do_or_die "cp $SHOREWALLDIR/functions $SHOREWALLLITEDIR >> $LOGFILE 2>&1" do_or_die "cp $SHOREWALLDIR/functions $SHOREWALLLITEDIR >> $LOGFILE 2>&1"
fi fi