2024-07-23 20:50:16 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if ! command -v docker &> /dev/null; then
|
|
|
|
echo "docker未安装"
|
2024-07-24 00:56:26 +08:00
|
|
|
exit
|
2024-07-23 20:50:16 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
declare pick_array
|
|
|
|
declare pick_number=6
|
|
|
|
declare pick
|
|
|
|
|
|
|
|
echo "========Docker========"
|
|
|
|
echo "1.换源"
|
|
|
|
echo "-----一键搭建软件-----"
|
|
|
|
cd "Config/Docker"
|
|
|
|
for i in *;do
|
|
|
|
pick_number=$((pick_number + 1))
|
|
|
|
pick_array[$pick_number]=$(awk -F '.' '{print $1}' <<< "$i")
|
|
|
|
echo "${pick_number}.${pick_array[$pick_number]}"
|
|
|
|
done
|
|
|
|
cd - >> /dev/null
|
|
|
|
echo "-----一键搭建软件-----"
|
2024-07-24 00:56:26 +08:00
|
|
|
echo "任意输入返回主菜单"
|
2024-07-23 20:50:16 +08:00
|
|
|
echo "========Docker========"
|
|
|
|
read -p "请输入要使用的功能:" pick
|
|
|
|
|
|
|
|
|
2024-07-24 00:56:26 +08:00
|
|
|
if [[ "${pick_number}" -gt 0 && "${pick}" -le "$((${#pick_array[*]}+${pick_number}))" ]];then
|
2024-07-23 20:50:16 +08:00
|
|
|
clear
|
|
|
|
bash "Config/Docker/${pick_array[${pick}]}.sh"
|
|
|
|
else
|
2024-07-24 00:56:26 +08:00
|
|
|
clear
|
2024-07-23 20:50:16 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
|