Update monitor_interface

This commit is contained in:
bergware
2025-06-09 04:44:53 +02:00
parent 19750fcf1c
commit 2dce3bf630

View File

@@ -87,12 +87,9 @@ while :; do
[[ -n $(ip -br addr show to ${ADDR[1]%/*} dev $PORT) ]] && ip addr del dev ${TASK[$i]}
;;
1) # up
IPA=$(ip -br addr show to ${ADDR[1]%/*} dev $PORT)
if [[ -f /var/tmp/$PORT.down ]]; then
# Special treatment for shim and vhost interfaces
[[ -n $IPA ]] && ip addr del dev ${TASK[$i]}
else
if [[ ! -f /var/tmp/$PORT.down ]]; then
# IP address not present? create it
IPA=$(ip -br addr show to ${ADDR[1]%/*} dev $PORT)
[[ -z $IPA ]] && ip addr add dev ${TASK[$i]}
fi
esac