forked from OreosLab/checkinpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_fast_cn.sh
More file actions
31 lines (26 loc) · 953 Bytes
/
api_fast_cn.sh
File metadata and controls
31 lines (26 loc) · 953 Bytes
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
#!/usr/bin/env sh
# shellcheck disable=SC2188
<<'COMMENT'
cron: 45 12 */7 * *
new Env('国内加速');
COMMENT
# alpine 换源
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# Python 换源
mkdir -p /root/.config/pip
cat >/root/.config/pip/pip.conf <<EOF
[global]
index-url=https://pypi.mirrors.ustc.edu.cn/simple/
EOF
# NPM 换源
npm config set registry https://registry.npmmirror.com/
# CPAN 换源
if ! (
perl -MCPAN -e 'CPAN::HandleConfig->load();' \
-e 'CPAN::HandleConfig->prettyprint("urllist")' |
grep -qF 'https://mirrors.tuna.tsinghua.edu.cn/CPAN/'
); then
perl -MCPAN -e 'CPAN::HandleConfig->load();' \
-e 'CPAN::HandleConfig->edit("urllist", "unshift", "https://mirrors.tuna.tsinghua.edu.cn/CPAN/");' \
-e 'CPAN::HandleConfig->commit()'
fi