Advertisement
LightProgrammer000

Redes Simples

Nov 19th, 2021
1,574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. while ((1))
  4. do
  5.     clear
  6.     echo -e "\033[01;31m # Impressao: \033[01;32m"
  7.     echo -e "\033[01;32m [r] Route    \033[01;32m"
  8.     echo -e "\033[01;33m [i] Ifconfig  \033[01;32m"
  9.     echo -e -n "\033\n[01;34m # Resp: \033[01;37m"
  10.     read -n 1 resp
  11.  
  12.     # Estrutura de decisao
  13.     if [[ $resp == "r" ]]
  14.     then
  15.         echo -e "\n\n\033[01;32m"
  16.         route -n
  17.         echo -e "\033[01;37m"
  18.         sleep 2
  19.    
  20.     elif [[ $resp == "i" ]]
  21.     then
  22.         echo -e "\n\n\033[01;33m"
  23.         ifconfig
  24.         echo -e "\033[01;37m"
  25.         sleep 2
  26.  
  27.     elif [[ $resp == "s" ]]
  28.     then
  29.         exit 1
  30.  
  31.     else
  32.         continue
  33.     fi
  34. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement