dispatcher: fix ifcfg-rh example dispatcher script (rh #1160013)
Routing table entries for a device get flushed when the device is deactivated, but rules table entries don't, so we have to flush them by hand.
This commit is contained in:
@@ -454,7 +454,8 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d
|
|||||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d
|
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d
|
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-down.d
|
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-down.d
|
||||||
%{__cp} examples/dispatcher/10-ifcfg-rh-routes.sh $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d
|
%{__cp} examples/dispatcher/10-ifcfg-rh-routes.sh $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/
|
||||||
|
%{__ln_s} ../10-ifcfg-rh-routes.sh $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d/
|
||||||
|
|
||||||
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/gnome-vpn-properties
|
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/gnome-vpn-properties
|
||||||
|
|
||||||
|
@@ -5,7 +5,12 @@
|
|||||||
# interfaces that have routing rules associated with them that can't
|
# interfaces that have routing rules associated with them that can't
|
||||||
# be expressed by NMSettingIPConfig. (Eg, policy-based routing.)
|
# be expressed by NMSettingIPConfig. (Eg, policy-based routing.)
|
||||||
|
|
||||||
# This should be installed in dispatcher.d/pre-up.d/
|
# This should be installed in both dispatcher.d/ and
|
||||||
|
# dispatcher.d/pre-up.d/
|
||||||
|
|
||||||
|
if [ "$2" != "pre-up" -a "$2" != "down" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
dir=$(dirname "$CONNECTION_FILENAME")
|
dir=$(dirname "$CONNECTION_FILENAME")
|
||||||
if [ "$dir" != "/etc/sysconfig/network-scripts" ]; then
|
if [ "$dir" != "/etc/sysconfig/network-scripts" ]; then
|
||||||
@@ -15,7 +20,15 @@ profile=$(basename "$CONNECTION_FILENAME" | sed -ne 's/^ifcfg-//p')
|
|||||||
if [ -z "$profile" ]; then
|
if [ -z "$profile" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
if ! [ -f "$dir/rule-$profile" -o -f "$dir/rule6-$profile" ]; then
|
||||||
if [ -f "$dir/rule-$profile" -o -f "$dir/rule6-$profile" ]; then
|
exit 0
|
||||||
/etc/sysconfig/network-scripts/ifup-routes "$DEVICE_IP_IFACE" "$profile"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case "$2" in
|
||||||
|
pre-up)
|
||||||
|
/etc/sysconfig/network-scripts/ifup-routes "$DEVICE_IP_IFACE" "$profile"
|
||||||
|
;;
|
||||||
|
down)
|
||||||
|
/etc/sysconfig/network-scripts/ifdown-routes "$DEVICE_IP_IFACE" "$profile"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
Reference in New Issue
Block a user