All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 11s
29 lines
656 B
Bash
29 lines
656 B
Bash
#!/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" |