写好主菜单

This commit is contained in:
lsy 2024-07-23 20:50:16 +08:00
commit 9f6ff02ade
11 changed files with 78 additions and 0 deletions

2
Config/Docker/Alist.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
echo "alist"

0
Config/Docker/Gitea.sh Normal file
View File

View File

View File

0
Config/Docker/Siyuan.sh Normal file
View File

0
Config/Docker/Typecho.sh Normal file
View File

0
Menus/Automation.sh Normal file
View File

0
Menus/Debian.sh Normal file
View File

38
Menus/Docker.sh Normal file
View File

@ -0,0 +1,38 @@
#!/bin/bash
if ! command -v docker &> /dev/null; then
echo "docker未安装"
bash Run.sh
fi
declare pick_array
declare pick_number=6
declare pick
echo "========Docker========"
echo "0.返回主菜单"
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 "-----一键搭建软件-----"
echo "========Docker========"
read -p "请输入要使用的功能:" pick
if [[ "$pick" == 0 ]]; then
clear
bash Run.sh
elif [[ "${pick_number}" -gt 0 && "${pick}" -le "$((${#pick_array[*]}+${pick_number}))" ]];then
clear
bash "Config/Docker/${pick_array[${pick}]}.sh"
else
exit
fi

10
Menus/Login.sh Normal file
View File

@ -0,0 +1,10 @@
#!bin/bash
echo "========Login========"
echo "0.返回主菜单"
echo "1.修改root密码"
echo "2.新建用户"
echo "3.安装密钥"
echo "4.管理ssh登录方式"
echo "5.更换ssh端口"
echo "6.ssh二次验证"
echo "========Login========"

28
Run.sh Normal file
View File

@ -0,0 +1,28 @@
#!/bin/bash
if ! command -v sudo &> /dev/null; then
echo "sudo未安装,部分命令无法正常运行"
fi
declare -a pick_array
declare pick_number=0
declare pick
echo "======Linux工具箱======"
cd Menus
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 "======Linux工具箱======"
read -p "请输入要使用的功能:" pick
if [[ "${pick}" -gt 0 && "${pick}" -le "${#pick_array[*]}" ]];then
clear
bash Menus/${pick_array[$pick]}.sh
else
exit
fi