25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
824 B

  1. #!/usr/bin/env bash
  2. menu () {
  3. while [ active=1 ]; do
  4. title
  5. echo "Please select a Entry"
  6. echo ""
  7. shopt -s nullglob
  8. moduleCat=(./modules/*)
  9. x=0
  10. for entry in "${moduleEnt[@]}"; do
  11. if [[ -d $entry ]]; then echo "$x:d - $entry"
  12. else [[ -f $entry ]]; then echo "$x:f - $entry"
  13. fi
  14. x=$((x+1))
  15. done
  16. echo "exit"
  17. read opt
  18. exitchk
  19. entSelect=`echo ${moduleEnt[$opt]} | sed 's|./modules/|../|'`
  20. submenu
  21. clear
  22. done
  23. }
  24. submenu () {
  25. clear
  26. while true; do
  27. title
  28. echo "Please select an Option from the $entSelect Category"
  29. echo ""
  30. shopt -s nullglob
  31. moduleOpt=($moduleEnt[$opt])
  32. x=0
  33. for module in "${moduleOpt[@]}"; do
  34. echo "$x - $module"
  35. x=$((x+1))
  36. done
  37. echo "back"
  38. read opt
  39. exitchk
  40. clear
  41. done
  42. }