HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/doc/arping/examples/arping.if-up
#!/bin/sh
set -e

if [ "${IF_ADDRESS}" = "" ] ; then
  exit 0
fi

. /lib/lsb/init-functions

IPUP=0
DOWN=0

if [ -f /etc/default/arping ] ; then 
	. /etc/default/arping
fi

if [ $IPUP = 0 ]; then
	exit 0
fi

log_action_begin_msg "Using arping to check duplicity of ${IF_ADDRESS}"

if arping -c 1 -d -I ${IFACE} ${IF_ADDRESS} > /dev/null ; then
  if [ $DOWN = 1 ]; then
  	ifconfig ${IFACE} down
	msg="Bringing ${IFACE} down. "
  fi
  msg=${msg}"Another computer is already using ${IF_ADDRESS}"
  status=1
else
  msg="No duplicates found"
  status=0
fi

log_action_end_msg ${status} "${msg}"

[ ${status} = 0 ]