Skip to content

Latest commit

 

History

History
70 lines (44 loc) · 1.13 KB

04-Lab-Exit-Codes.md

File metadata and controls

70 lines (44 loc) · 1.13 KB

Lab Exit-Codes

  • Take me to the Lab
  1. Solution is given below

    Exit Status - 0
    
  2. Solution is given below

    Exit Status - 127
    
  3. Solution is given below

    Exit Status - 126
    
  4. Solution is given below

    mission_name=$1
    
    mkdir $mission_name
    
    rocket-add $mission_name
    
    rocket-start-power $mission_name
    rocket-internal-power $mission_name
    rocket-start-sequence $mission_namerocket-start-engine $mission_name
    rocket-lift-off $mission_name
    
    rocket_status=$(rocket-status $mission_name)
    
    echo "The status of launch is $rocket_status"
    
    if [ $rocket_status = "launching" ]
    then
      sleep 2
      rocket_status=$(rocket-status $mission_name)
    fi
    
    if [ $rocket_status = "failed" ]
    then
      rocket-debug
      exit 1
    fi