#!/bin/sh
. /etc/profile
oe_setup_addon service.system.tinc

case "$SUBNET" in
   ??:??:??:??:??:??)
      :
      ;;
   *)
      if [ "$NAME" == "$NODE" ]
      then
         ip addr replace "$SUBNET/$tinc_mask" dev "$INTERFACE"
      elif [ "$tinc_mask" == "32" ]
      then
         ip route replace "$SUBNET" dev "$INTERFACE"
      fi
      ;;
esac
