更新软件结构
This commit is contained in:
parent
358438cef0
commit
edc0c5b106
25
Run.sh
25
Run.sh
@ -9,23 +9,36 @@ declare -a pick_array
|
|||||||
declare pick_number
|
declare pick_number
|
||||||
declare pick
|
declare pick
|
||||||
declare path_script=$(dirname $0)
|
declare path_script=$(dirname $0)
|
||||||
|
path_script="${path_script}/Config"
|
||||||
|
declare path_local=$path_script
|
||||||
|
declare file_name
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
|
if [[ -e "${path_local}/test.sh" ]]; then
|
||||||
|
bash "${path_local}/test.sh"
|
||||||
|
fi
|
||||||
pick_number=0
|
pick_number=0
|
||||||
echo "======Linux工具箱======"
|
echo "======$(basename $0 .sh)======"
|
||||||
for i in "${path_script}/Menus"/*
|
for i in "${path_local}"/*
|
||||||
do
|
do
|
||||||
|
file_name=$(awk -F '.' '{print $1}' <<< "$(basename $i)")
|
||||||
|
if [[ $file_name == "test" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
pick_number=$((pick_number + 1))
|
pick_number=$((pick_number + 1))
|
||||||
pick_array[$pick_number]=$(awk -F '.' '{print $1}' <<< "$(basename $i)")
|
pick_array[$pick_number]=$file_name
|
||||||
echo "${pick_number}.${pick_array[$pick_number]}"
|
echo "${pick_number}.${pick_array[$pick_number]}"
|
||||||
done
|
done
|
||||||
echo "======Linux工具箱======"
|
|
||||||
read -p "请输入要使用的功能:" pick
|
read -p "请输入要使用的功能:" pick
|
||||||
if [[ "${pick}" =~ [1-${#pick_array[*]}] ]];then
|
if [[ "${pick}" =~ [1-${#pick_array[*]}] ]];then
|
||||||
clear
|
clear
|
||||||
bash "${path_script}/Menus/${pick_array[$pick]}.sh" "$path_script"
|
if [[ -d "${path_local}/${pick_array[$pick]}" ]]; then
|
||||||
|
path_local="${path_local}/${pick_array[$pick]}"
|
||||||
|
elif [[ -e "${path_script}/${pick_array[$pick]}.sh" ]]; then
|
||||||
|
bash "${path_script}/${pick_array[$pick]}.sh"
|
||||||
|
path_local=$path_script
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user