#!/usr/bin/env sh

. /etc/create_ap.conf

if [ "$1" = "$WIFI_IFACE" ]; then

  if [ "$2" = "up" ]; then
    echo "Restarting auto-ap service"
    systemctl restart auto-ap

  elif [ "$2" = "down" ]; then
    echo "Stopping auto-ap service"
    systemctl stop auto-ap
  fi

fi
