init/init-all.sh
Martin 21945b816a
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 11s
[+] 增加 k8s 基础环境初始化脚本
2025-01-22 15:17:32 +08:00

29 lines
656 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
download_and_run() {
local filename="$1"
local url="https://git.martin98.com/MartinFarm/init/raw/branch/main/$1"
if [ ! -f "$filename" ]; then
echo "文件 $filename 不存在,正在下载..."
curl -sSL "$url" -o "$filename"
if [ $? -ne 0 ]; then
echo "下载失败请检查网络连接或URL是否正确。"
exit 1
fi
fi
bash "$filename"
rm "$filename"
}
# apt + ntp
download_and_run "init-apt.sh"
# docker-ce
download_and_run "init-docker.sh"
# npm
download_and_run "init-npm.sh"
# pip
download_and_run "init-pip.sh"
# git
download_and_run "init-git.sh"