How do I disable backwards Sprinting?

using UnityEngine;
using System.Collections;

    public class Movement : MonoBehaviour {
    //Variables
    private float speed = 30F;
    public float jumpSpeed = 8.0F;
    public float gravity = 20.0F;
	public float sprint = 6.0F;
    private Vector3 moveDirection = Vector3.zero;
	//cancelback disables sprinting backward
	private bool bsprint = false;
    
	void Awake() {
		bsprint = false;
	}
	
    void Update() {
    CharacterController controller = GetComponent<CharacterController>();
    	// is the controller on the ground?
   	 if (controller.isGrounded) {
    	//Feed moveDirection with input.
    	moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
    	moveDirection = transform.TransformDirection(moveDirection);
    	//Multiply it by speed.
    	moveDirection *= speed;
    	//Jumping
   	 if (Input.GetButton("Jump"))
    	moveDirection.y = jumpSpeed;
		//Sprint Speed
	 if (Input.GetKeyDown (KeyCode.LeftShift))
		speed = sprint;
		bsprint = true;
		//Stop Sprint
	 if (Input.GetKeyUp (KeyCode.LeftShift))
		speed = 30F;
		bsprint = false;
	//Stop Backward Sprinting
	 if (bsprint == true)
		 if (Input.GetKeyDown (KeyCode.S))
					speed = 30F;
			
	
     
    }
    //Applying gravity to the controller
    moveDirection.y -= gravity * Time.deltaTime;
    //Making the character move
    controller.Move(moveDirection * Time.deltaTime);
    }
    }

Use this, if (Input.GetKeyDown (KeyCode.LeftShift)&&!Input.GetKeyDown (KeyCode.S))
instead of if (Input.GetKeyDown (KeyCode.LeftShift) at line 30. And go ahead and get rid of bsprint. Hope I helped!

Edit
Just realized, you made a silly mistake, you forgot your curly brackets around your LeftShiftUp and LeftShiftDown if statments. Please vote up for good answer!

If anyone still struggles with sprinting sideways or backwards disabling try this:ยจ

    public float speed;
    public float walkSpeed = 5f;
    public float SprintSpeed = 10f;

    if (Input.GetKeyDown(KeyCode.LeftShift) && Input.GetAxis("Vertical") > 0)
    {
        Speed = SprintSpeed;
    }
    if (Input.GetKeyUp(KeyCode.LeftShift))
    {
        Speed = walkSpeed;
    }