You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 rivejä
943 B

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