-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathins
57 lines (47 loc) · 1.52 KB
/
ins
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
#
# Download and run the main script
set -e
readonly path='/tmp/y2ai'
readonly ext='.tar.zst'
url="https://github.com/nedorazrab0/y2ai/releases/download/rolling/\
${path##*/}${ext}"
# Net tweaks
sysctl -w net.core.netdev_max_backlog=4096
sysctl -w net.ipv4.tcp_slow_start_after_idle=0
sysctl -w net.ipv4.tcp_rfc1337=1
sysctl -w net.ipv4.tcp_timestamps=0
sysctl -w net.ipv4.tcp_fastopen=3
sysctl -w net.core.somaxconn=8192
sysctl -w net.ipv4.tcp_ecn=1
sysctl -w net.ipv4.tcp_congestion_control='bbr'
mkdir -p /etc/systemd/{resolved,timesyncd}.conf.d
cat << 'EOF' > /etc/systemd/resolved.conf.d/dns.conf
[Resolve]
DNS=1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
FallbackDNS=8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
Domains=~.
Cache=yes
DNSOverTLS=yes
DNSSEC=true
EOF
cat << 'EOF' > /etc/systemd/timesyncd.conf.d/ntp.conf
[Time]
NTP=time.cloudflare.com
FallbackNTP=pool.ntp.org
EOF
systemctl restart systemd-{timesyncd,resolved,networkd}
# main
curl -fL -o "${path}${ext}" "${url}"
sha="$(openssl sha256 ${path}${ext} | cut -d ' ' -f2)"
shapart="${sha:0:2}-${sha:2:3}-${sha:5:3}--${sha:8:2}-${sha:10:3}-${sha:13:3}"
echo
echo '- SHA256 Part:'
echo " ${shapart}"
echo '- Press [Enter] to continue'
read -r ans && unset ans
[[ -d "${path}" ]] && rm -rf "${path}"
mkdir -p "${path}"
zstd -dc "${path}${ext}" | bsdtar -x -C "${path}"
rm -f "${path}${ext}"
exec bash "${path}/main"