[C#]Toggle Run on/off

Hello, I want to make my current run script which currently makes you run when the left or right shit key is pressed, but I want to change that to being you have to press the shift key to begin running, then hit it again to stop. Code below, thanks in advance.

using UnityEngine;
using System.Collections;

public class charRunCrouch : MonoBehaviour 
{
	public float walkSpeed = 7; // regular speed
	public float crchSpeed = 3; // crouching speed
	public float runSpeed = 15; // run speed
	bool running = false;
	
	private CharacterMotor chMotor;
	private Transform tr;
	private float dist; // distance to ground
	
	// Use this for initialization
	void Start () 
	{
		chMotor =  GetComponent<CharacterMotor>();
		tr = transform;
		CharacterController ch = GetComponent<CharacterController>();
		dist = ch.height/2; // calculate distance to groundw
	}
	
	// Update is called once per frame
	void FixedUpdate ()
	{
		float vScale = 1.0f;
		float speed = walkSpeed;
		
		if ((Input.GetKey("left shift") || Input.GetKey("right shift")) && chMotor.grounded)
		{
			speed = runSpeed;     
		
		}
		
		if (Input.GetKey("left ctrl") || Input.GetKey("right ctrl"))
		{ // press C to crouch
			vScale = 0.5f;
			speed = crchSpeed; // slow down when crouching
		}
		
		chMotor.movement.maxForwardSpeed = speed; // set max speed
		float ultScale = tr.localScale.y; // crouch/stand up smoothly 
		
		Vector3 tmpScale = tr.localScale;
		Vector3 tmpPosition = tr.position;
		
		tmpScale.y = Mathf.Lerp(tr.localScale.y, vScale, 5 * Time.deltaTime);
		tr.localScale = tmpScale;
		
		tmpPosition.y += dist * (tr.localScale.y - ultScale); // fix vertical position       
		tr.position = tmpPosition;
	}
}

Try The Following:

           if ((Input.GetKeyDown("left shift") || Input.GetKeyDown("right shift")) && chMotor.grounded)
           {
             if(speed = runSpeed)       //If The player is running and shift is pressed, then the player will walk.
                    speed = walkSpeed;

             if(speed != runSpeed)      //If The player is walking and shift is pressed, then the player will run.
                    speed = runSpeed;
     
           }

This worked for me. Toggles an action on keydown. Have to release it to toggle again.

private bool isWalking = false;
private bool wasLShiftReleased = true;

void FixedUpdate ()
{
//toggle Walk/Run
        if (Input.GetKey(KeyCode.LeftShift)) {
            if (wasLShiftReleased == true) //did it change
            {
                isWalking = !isWalking;
                wasLShiftReleased = false;
            }
        }
        else 
        {
            wasLShiftReleased = true;
        }   
}