Skip to content

Commit cc6d550

Browse files
committed
新增install-docker2 docker-compose安装;新增g安装脚本
1 parent f80aff9 commit cc6d550

File tree

5 files changed

+101
-2
lines changed

5 files changed

+101
-2
lines changed

main.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ show_help() {
1212
echo " CheckSSL (download)"
1313
echo " install-cri-docker (download|execute)"
1414
echo " install-nginx (download|execute)"
15+
echo " install-g (download|execute)"
1516
echo " mng (download)"
1617
echo " OpenSSL (download|execute)"
1718
echo " SystemInfoMonitor (download)"
@@ -65,6 +66,9 @@ else
6566
"env")
6667
url="https://download.elisky.cn/scripts/shell/.env-template"
6768
;;
69+
"install-g")
70+
url="https://download.elisky.cn/scripts/shell/install-gvm.sh"
71+
;;
6872
*)
6973
show_help
7074
exit 1

shell/install-docker2.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ docker_daemon_install() {
165165
sudo sh -c 'cat > /etc/docker/daemon.json' <<EOF
166166
{
167167
"registry-mirrors": [
168-
"https://docker.eli1.top"
168+
"https://docker.eli1.top",
169+
"https://docker.m.daocloud.io"
169170
]
170171
}
171172
EOF
@@ -193,7 +194,15 @@ main() {
193194
systemctl daemon-reload
194195
systemctl enable containerd.service --now
195196
systemctl enable docker.service --now
197+
mkdir -p /usr/libexec/docker/cli-plugins
198+
curl -Ls https://github.eli1.top/https://github.eli1.top/https://github.com/docker/compose/releases/download/v2.36.1/docker-compose-`uname -s`-`uname -m` > /usr/libexec/docker/cli-plugins/docker-compose;chmod a+x /usr/libexec/docker/cli-plugins/docker-compose
196199
# newgrp docker
200+
if [ -x "$(command -v bash)" ]; then
201+
source <(docker completion bash);echo "source <(docker completion bash)" >> ${HOME}/.bashrc
202+
fi
203+
if [ -x "$(command -v zsh)" ]; then
204+
source <(docker completion zsh);echo "source <(docker completion zsh)" >> ${HOME}/.zshrc
205+
fi
197206
else
198207
echo "Failed to download Docker ${version}."
199208
fi

shell/install-gvm.sh

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
function get_arch() {
5+
a=$(uname -m)
6+
case ${a} in
7+
"x86_64" | "amd64")
8+
echo "amd64"
9+
;;
10+
"i386" | "i486" | "i586")
11+
echo "386"
12+
;;
13+
"aarch64" | "arm64")
14+
echo "arm64"
15+
;;
16+
"armv6l" | "armv7l")
17+
echo "arm"
18+
;;
19+
"s390x")
20+
echo "s390x"
21+
;;
22+
*)
23+
echo ${NIL}
24+
;;
25+
esac
26+
}
27+
28+
function get_os() {
29+
echo $(uname -s | awk '{print tolower($0)}')
30+
}
31+
32+
function main() {
33+
local release="1.7.0"
34+
local os=$(get_os)
35+
local arch=$(get_arch)
36+
local dest_file="${HOME}/.g/downloads/g${release}.${os}-${arch}.tar.gz"
37+
local url="https://github.eli1.top/https://github.com/voidint/g/releases/download/v${release}/g${release}.${os}-${arch}.tar.gz"
38+
39+
echo "[1/3] Downloading ${url}"
40+
rm -f "${dest_file}"
41+
if [ -x "$(command -v wget)" ]; then
42+
wget -q -P "${HOME}/.g/downloads" "${url}"
43+
else
44+
curl -s -S -L --create-dirs -o "${dest_file}" "${url}"
45+
fi
46+
47+
echo "[2/3] Install g to the ${HOME}/.g/bin"
48+
mkdir -p "${HOME}/.g/bin"
49+
tar -xz -f "${dest_file}" -C "${HOME}/.g/bin"
50+
chmod +x "${HOME}/.g/bin/g"
51+
52+
echo "[3/3] Set environment variables"
53+
cat >${HOME}/.g/env <<-'EOF'
54+
#!/bin/sh
55+
# g shell setup
56+
export GOROOT="${HOME}/.g/go"
57+
export PATH="${HOME}/.g/bin:${GOROOT}/bin:${GOPATH}/bin:$PATH"
58+
export G_MIRROR=https://golang.google.cn/dl/
59+
EOF
60+
61+
if [ -x "$(command -v bash)" ]; then
62+
cat >>${HOME}/.bashrc <<-'EOF'
63+
64+
[ -s "${HOME}/.g/env" ] && \. "${HOME}/.g/env" # g shell setup
65+
66+
EOF
67+
source ${HOME}/.bashrc
68+
fi
69+
70+
if [ -x "$(command -v zsh)" ]; then
71+
cat >>${HOME}/.zshrc <<-'EOF'
72+
73+
[ -s "${HOME}/.g/env" ] && \. "${HOME}/.g/env" # g shell setup
74+
75+
EOF
76+
source ${HOME}/.zshrc
77+
fi
78+
79+
echo -e "\nTo configure your current shell, run:\nsource \"$HOME/.g/env\""
80+
81+
exit 0
82+
}
83+
84+
main

text/AdGuardHome.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ dns:
7272
use_http3_upstreams: false
7373
serve_plain_dns: true
7474
hostsfile_enabled: true
75+
pending_requests:
76+
enabled: true
7577
tls:
7678
enabled: true
7779
server_name: dns.s.eli1.top

text/czb.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 更新时间:2025-04-16 02:30:02
1+
# 更新时间:2025-05-21 02:30:01
22

33
# 来自https://github.eli1.top/https://raw.githubusercontent.com/BlueSkyXN/AdGuardHomeRules/master/ok.txt
44

0 commit comments

Comments
 (0)