mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
core: 支持原系统为 alpine edge
This commit is contained in:
parent
4131fbc461
commit
c830907cef
12
reinstall.sh
12
reinstall.sh
@ -156,9 +156,15 @@ test_url() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add_community_repo_for_alpine() {
|
add_community_repo_for_alpine() {
|
||||||
if ! grep -x 'http.*/community' /etc/apk/repositories; then
|
# 先检查原来的repo是不是egde
|
||||||
alpine_ver=$(cut -d. -f1,2 </etc/alpine-release)
|
if grep -x 'http.*/edge/main' /etc/apk/repositories; then
|
||||||
echo http://dl-cdn.alpinelinux.org/alpine/v$alpine_ver/community >>/etc/apk/repositories
|
alpine_ver=edge
|
||||||
|
else
|
||||||
|
alpine_ver=v$(cut -d. -f1,2 </etc/alpine-release)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! grep -x "http.*/$alpine_ver/community" /etc/apk/repositories; then
|
||||||
|
echo http://dl-cdn.alpinelinux.org/alpine/$alpine_ver/community >>/etc/apk/repositories
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
trans.sh
12
trans.sh
@ -30,9 +30,15 @@ error_and_exit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add_community_repo() {
|
add_community_repo() {
|
||||||
if ! grep -x 'http.*/community' /etc/apk/repositories; then
|
# 先检查原来的repo是不是egde
|
||||||
alpine_ver=$(cut -d. -f1,2 </etc/alpine-release)
|
if grep -x 'http.*/edge/main' /etc/apk/repositories; then
|
||||||
echo http://dl-cdn.alpinelinux.org/alpine/v$alpine_ver/community >>/etc/apk/repositories
|
alpine_ver=edge
|
||||||
|
else
|
||||||
|
alpine_ver=v$(cut -d. -f1,2 </etc/alpine-release)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! grep -x "http.*/$alpine_ver/community" /etc/apk/repositories; then
|
||||||
|
echo http://dl-cdn.alpinelinux.org/alpine/$alpine_ver/community >>/etc/apk/repositories
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user