forked from extern/shorewall_code
Change installation of ifupdown one more time
This commit is contained in:
parent
74043784ea
commit
c256074c94
@ -254,28 +254,27 @@ fi
|
||||
#
|
||||
# Install the ifupdown script
|
||||
#
|
||||
if [ -n "${PREFIX}" ]; then
|
||||
mkdir -p ${PREFIX}/sbin
|
||||
fi
|
||||
|
||||
install_file ifupdown.sh ${PREFIX}/sbin/shorewall-ifupdown 744
|
||||
mkdir -p ${PREFIX}/usr/share/shorewall-init
|
||||
|
||||
install_file ifupdown.sh ${PREFIX}/usr/share/shorewall-init/ifupdown 0544
|
||||
|
||||
if [ -d ${PREFIX}/etc/NetworkManager ]; then
|
||||
install_file ifupdown.sh ${PREFIX}/etc/NetworkManager/dispatcher.d/01-shorewall 0744
|
||||
install_file ifupdown.sh ${PREFIX}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
|
||||
fi
|
||||
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
ln -sf /sbin/shorewall-ifupdown ${PREFIX}/etc/network/if-up.d/shorewall
|
||||
ln -sf /sbin/shorewall-ifupdown ${PREFIX}/etc/network/if-post-down.d/shorewall
|
||||
install_file ifupdown.sh ${PREFIX}/etc/network/if-up.d/shorewall 0544
|
||||
install_file ifupdown.sh ${PREFIX}/etc/network/if-post-down.d/shorewall 0544
|
||||
elif [ -n "$SUSE" ]; then
|
||||
ln -sf /sbin/shorewall-ifupdown ${PREFIX}/etc/sysconfig/network/if-up.d/shorewall
|
||||
ln -sf /sbin/shorewall-ifupdown ${PREFIX}/etc/sysconfig/network/if-down.d/shorewall
|
||||
install_file ifupdown.sh ${PREFIX}/etc/sysconfig/network/if-up.d/shorewall 0744
|
||||
install_file ifupdown.sh ${PREFIX}/etc/sysconfig/network/if-down.d/shorewall 0744
|
||||
elif [ -n "$REDHAT" ]; then
|
||||
if [ -f ${PREFIX}/sbin/ifup-local -o -f ${PREFIX}/sbin/ifdown-local ]; then
|
||||
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; up/down events will not be handled"
|
||||
else
|
||||
ln -s /sbin/shorewall-ifupdown ${PREFIX}/sbin/ifup-local
|
||||
ln -s /sbin/shorewall-ifupdown ${PREFIX}/sbin/ifdown-local
|
||||
install_file ifupdown.sh ${PREFIX}/sbin/ifup-local 0544
|
||||
install_file ifupdown.sh ${PREFIX}/sbin/ifdown-local 0544
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -50,17 +50,19 @@ if [ $1 -eq 1 ]; then
|
||||
fi
|
||||
|
||||
if [ -f /etc/SuSE-release ]; then
|
||||
ln -sf /sbin/shorewall-ifupdown /etc/sysconfig/network/if-up.d/shorewall
|
||||
ln -sf /sbin/shorewall-ifupdown /etc/sysconfig/network/if-down.d/shorewall
|
||||
cp -af /usr/share/shorewall-init/ifupdown.sh /etc/sysconfig/network/if-up.d/shorewall
|
||||
cp -af /usr/share/shorewall-init/ifupdown.sh /etc/sysconfig/network/if-down.d/shorewall
|
||||
else
|
||||
if [ -f /sbin/ifup-local -o -f /sbin/ifdown-local ]; then
|
||||
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; ifup/ifdown events will not be handled" >&2
|
||||
else
|
||||
ln -s shorewall-ifupdown /sbin/ifup-local
|
||||
ln -s shorewall-ifupdown /sbin/ifdown-local
|
||||
cp -a /usr/share/shorewall-init/ifupdown.sh /sbin/ifup-local
|
||||
cp -a /usr/share/shorewall-init/ifupdown.sh /sbin/ifdown-local
|
||||
fi
|
||||
|
||||
if [ -d /etc/NetworkManager/dispatcher.d/ ]; then
|
||||
cp -af /usr/share/shorewall-init/ifupdown.sh /etc/NetworkManager/dispatcher.d/01-shorewall
|
||||
fi
|
||||
|
||||
ln -sf /sbin/shorewall-ifupdown /etc/NetworkManager/dispatcher.d/01-shorewall
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -73,8 +75,8 @@ if [ $1 -eq 0 ]; then
|
||||
/sbin/chkconfig --del shorewall-init
|
||||
fi
|
||||
|
||||
[ "$(readlink -m -q /sbin/ifup-local)" = /sbin/shorewall-ifupdown ] && rm -f /sbin/ifup-local
|
||||
[ "$(readlink -m -q /sbin/ifdown-local)" = /sbin/shorewall-ifupdown ] && rm -f /sbin/ifdown-local
|
||||
grep -q Shorewall /sbin/ifup-local && rm -f /sbin/ifup-local
|
||||
grep -q Shorewall /sbin/ifdown-local && rm -f /sbin/ifdown-local
|
||||
|
||||
rm -f /etc/NetworkManager/dispatcher.d/01-shorewall
|
||||
|
||||
@ -90,7 +92,7 @@ fi
|
||||
%attr(0755,root,root) %dir /usr/share/shorewall-init
|
||||
|
||||
%attr(0644,root,root) /usr/share/shorewall-init/version
|
||||
%attr(0544,root,root) /sbin/shorewall-ifupdown
|
||||
%attr(0544,root,root) /usr/share/shorewall-init/ifupdown.sh
|
||||
|
||||
%doc COPYING changelog.txt releasenotes.txt
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user