2024-07-23 20:50:16 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-09-21 16:25:44 +08:00
|
|
|
declare path_script=$1
|
2024-09-23 16:53:13 +08:00
|
|
|
declare file_name=$(basename $0 .sh)
|
2024-07-23 20:50:16 +08:00
|
|
|
|
|
|
|
declare pick_array
|
|
|
|
declare pick_number=6
|
|
|
|
declare pick
|
|
|
|
|
2024-09-25 00:51:25 +08:00
|
|
|
echo "========$(basename $0 .sh)========"
|
2024-07-23 20:50:16 +08:00
|
|
|
echo "1.换源"
|
2024-07-24 12:50:44 +08:00
|
|
|
echo "2.清除所有未使用镜像"
|
2024-07-23 20:50:16 +08:00
|
|
|
echo "-----一键搭建软件-----"
|
2024-09-23 16:53:13 +08:00
|
|
|
for i in "${path_script}/Config/${file_name}"/*;do
|
2024-07-23 20:50:16 +08:00
|
|
|
pick_number=$((pick_number + 1))
|
2024-09-21 18:07:23 +08:00
|
|
|
pick_array[$pick_number]=$(awk -F '.' '{print $1}' <<< "$(basename $i)")
|
2024-07-23 20:50:16 +08:00
|
|
|
echo "${pick_number}.${pick_array[$pick_number]}"
|
|
|
|
done
|
|
|
|
echo "-----一键搭建软件-----"
|
2024-07-24 00:56:26 +08:00
|
|
|
echo "任意输入返回主菜单"
|
2024-07-23 20:50:16 +08:00
|
|
|
read -p "请输入要使用的功能:" pick
|
|
|
|
|
2024-07-24 12:50:44 +08:00
|
|
|
clear
|
2024-07-23 20:50:16 +08:00
|
|
|
|
2024-07-24 12:50:44 +08:00
|
|
|
if [[ $pick == '1' ]];then
|
2024-09-26 10:53:51 +08:00
|
|
|
|
2024-07-24 12:50:44 +08:00
|
|
|
|
|
|
|
elif [[ $pick == '2' ]];then
|
2024-09-26 10:53:51 +08:00
|
|
|
|
2024-09-25 00:51:25 +08:00
|
|
|
elif [[ "${pick}" =~ [${pick_number}-${#pick_array[*]}] ]];then
|
2024-07-24 12:50:44 +08:00
|
|
|
|
2024-07-23 20:50:16 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
|