将所有调用文件的菜单文件名替换
This commit is contained in:
parent
55e856934f
commit
de69bb307a
@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare file_name=$(basename $0 .sh)
|
||||
declare path_script=$1
|
||||
declare pick
|
||||
echo "========Automation========"
|
||||
declare print_number=0
|
||||
declare -a print_array
|
||||
for i in "${path_script}/Config/Automation"/*;do
|
||||
for i in "${path_script}/Config/${file_name}"/*;do
|
||||
print_number=$((print_number + 1))
|
||||
print_array[$print_number]=$(awk -F '.' '{print $1}' <<< "$(basename $i)")
|
||||
echo "${print_number}.${print_array[$print_number]}"
|
||||
@ -49,11 +49,11 @@ if [[ "$cron" == '* * * * * ' ]];then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -f "${path_script}/Config/Automation/${print_array[pick]}.sh" ]];then
|
||||
if [[ -f "${path_script}/Config/${file_name}/${print_array[pick]}.sh" ]];then
|
||||
echo "该路径文件已经存在"
|
||||
fi
|
||||
|
||||
bash "${path_script}/Config/Automation/${print_array[pick]}.sh" "$path"
|
||||
bash "${path_script}/Config/${file_name}/${print_array[pick]}.sh" "$path"
|
||||
|
||||
chmod +x "${path}/${print_array[pick]}.sh"
|
||||
declare cron_job="${cron} ${path}/${print_array[pick]}.sh"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare path_script=$1
|
||||
|
||||
declare file_name=$(basename $0 .sh)
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "docker未安装"
|
||||
exit
|
||||
@ -15,7 +15,7 @@ echo "========Docker========"
|
||||
echo "1.换源"
|
||||
echo "2.清除所有未使用镜像"
|
||||
echo "-----一键搭建软件-----"
|
||||
for i in "${path_script}/Config/Docker"/*;do
|
||||
for i in "${path_script}/Config/${file_name}"/*;do
|
||||
pick_number=$((pick_number + 1))
|
||||
pick_array[$pick_number]=$(awk -F '.' '{print $1}' <<< "$(basename $i)")
|
||||
echo "${pick_number}.${pick_array[$pick_number]}"
|
||||
@ -91,7 +91,7 @@ elif [[ "${pick}" -gt "$((${pick_number}-${#pick_array[*]}))" && "${pick}" -le "
|
||||
exit
|
||||
fi
|
||||
|
||||
bash "${path_script}/Config/Docker/${pick_array[${pick}]}.sh" "$file_path" "$port"
|
||||
bash "${path_script}/Config/${file_name}/${pick_array[${pick}]}.sh" "$file_path" "$port"
|
||||
echo "${pick_array[${pick}]}安装完成,访问端口${port}"
|
||||
fi
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
declare path_script=$1
|
||||
declare file_name=$(basename $0)
|
||||
declare file_name=$(basename $0 .sh)
|
||||
echo "========Other========"
|
||||
declare print_number=0
|
||||
declare -a print_arr
|
||||
|
Loading…
Reference in New Issue
Block a user