Files
ipx-utils/conf/network-stop.sh.in
2026-04-30 19:40:14 +02:00

51 lines
1.0 KiB
Bash

#!/bin/sh
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# IPX stop helper for systemd and OpenRC.
#
# This script disables automatic IPX behaviour, removes configured static
# routes, removes all configured IPX interfaces and deletes the internal IPX
# network if present.
set -u
retval=0
oldifs=${IFS}
IFS='
'
for entry in ${IPX_ROUTES:-}; do
[ -n "${entry}" ] || continue
case "${entry}" in
\#*)
continue
;;
esac
target=${entry%%:*}
if ! @sbindir@/ipx_route del "${target}"; then
printf '%s\n' "ipx: failed to remove route to ${target}" >&2
retval=1
fi
done
IFS=${oldifs}
if ! @sbindir@/ipx_configure --auto_primary=off --auto_interface=off; then
printf '%s\n' "ipx: failed to disable automatic IPX configuration" >&2
retval=1
fi
if ! @sbindir@/ipx_interface delall; then
printf '%s\n' "ipx: failed to remove IPX interfaces" >&2
retval=1
fi
if ! @sbindir@/ipx_internal_net del; then
:
fi
exit "${retval}"