#!/bin/sh
# Reload the gw6c daemon when an interface comes up.

set -e

# We don't restart for loopback
if [ "$IFACE" = lo ] ; then
  exit 0
fi

# Make sure the binary is available
if [ ! -x /usr/sbin/gw6c ]; then
  exit 0
fi

# Restart only if the daemon was running already
/usr/bin/pgrep -f ^/usr/sbin/gw6c >/dev/null
if [ $? != 0 ]; then
  exit 0
fi
invoke-rc.d gw6c restart

exit 0
