How to disable point lights not in the camera frustum


I feel a bit crazy asking this since I can’t find this question anywhere.

I have a load of lights in my scene. Can I do something so that lights are disabled when not in camera view or behind walls?

Thank you

Maybe its not exactly what you want but in a old project I made this script to disable lights when they where to a certain distance from the player.

using UnityEngine;
using System.Collections;

public class LightScript: MonoBehaviour {

	public float availableDistance;
	private float Distance;
    private Light Lightcomponent;
    private GameObject Player;
    void Start(){
    Lightcomponent = gameObject.GetComponent<Light>();
    Player = GameObject.FindGameObjectWithTag("Player");
	// Update is called once per frame
	void Update () {
	Distance = Vector3.Distance(Player.transform.position, transform.position);

		if (Distance < availableDistance){
		Lightcomponent.enabled = true;	
		if (Distance > availableDistance){
		Lightcomponent.enabled = false;