Advertisement
EndymionSpr

BashBash

Mar 25th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.03 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. opcja=
  4. userid=$(id -u)
  5.  
  6. function system_info {
  7.  
  8. if exist $system_info_file then rm -f system_info_file echo "Usuniecie pliku system_info_file" fi
  9. touch system_info_file echo "Tworzenie pliku $system_info_file"
  10. printf "Zalogowany uzytkownik : " && whoami >> system_info_file
  11. printf "Katalog domowy        : " && echo $HOME >> system_info_file
  12. echo "info o pamieci" >> system_info_file
  13. free -m >> system_info_file
  14. echo "Calkowita przestrzen na dysku" >> system_info_file
  15. sudo df >> system_info_file
  16. echo "Przestrzen katalogu domowego uzytkownika:" >> system_info_file
  17. du -hs $HOME >> system_info_file
  18. echo "Zapisano informacje o systemie" }
  19.  
  20. function main_menu {
  21.  
  22. clear
  23.     echo -e "1 - Zbierz info o systemie /n2 - Wyswietl zapisane informacje
  24. 3 - Utworz grupe /n4 - Utworz uzytkownika /n5 - Pobierz i przetworz plik
  25. 6 - Wyszukaj frazy w plikach /n0 - Opuszczenie Skryptu" }
  26.  
  27. until ["$opcja" -eq "0" ]; do
  28.     main_menu
  29.  
  30.     case "$opcja" in
  31.     "1") system_info ;;
  32.     "2") cat system_info ;;
  33.     "3")  ;;
  34.     "4")  ;;
  35.     esac
  36. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement