- #!/usr/bin/env bash
-
- menu () {
- rootDir="./modules"
- currentDir="./modules"
- previousDir="./modules"
- while [ active=1 ]; do
- title
- echo "Current Dir: $"
- echo "Please select and Entry"
- echo ""
- shopt -s nullglob
- lsModDir="$currentDir*"
- moduleEnt=($lsModDir)
- x=0
- for entry in "${moduleEnt[@]}"; do
- if [ -d $entry ]; then echo "$x:d - $entry"
- elif [ -f $entry ]; then echo "$x:m - $entry"
- fi
- x=$((x+1))
- done
- echo "exit"
- read opt
- exitchk
- entSelect=`echo ${moduleEnt[$opt]} | sed 's|\$previousDir|..|'`
- clear
- done
- }
-
- submenu () {
- clear
- while true; do
- title
- echo "Please select an Option from the $entSelect Category"
- echo ""
- shopt -s nullglob
- moduleOpt=($moduleEnt[$opt])
- x=0
- for module in "${moduleOpt[@]}"; do
- echo "$x - $module"
- x=$((x+1))
- done
- echo "back"
- read opt
- exitchk
- clear
- done
- }
|