#!/bin/bash
# Check if this the ip address has updated

EXPECTED_IP_ADDR="50.52.118.232"
ACTUAL_IP_ADDR="$(curl ifconfig.me/ip)"
NTFY_URL="ntfy.sh/hr8fhsk"

if [[ "$EXPECTED_IP_ADDR" == "$ACTUAL_IP_ADDR" ]]; 
then
  exit 0
else 
  curl \
  -d "IP addr changed. Expected: $EXPECTED_IP_ADDR Got: $ACTUAL_IP_ADDR Consider updating cloudflare etc." \
  "$NTFY_URL"

  exit 1
fi
