mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +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() {
|
||||
if ! grep -x 'http.*/community' /etc/apk/repositories; then
|
||||
alpine_ver=$(cut -d. -f1,2 </etc/alpine-release)
|
||||
echo http://dl-cdn.alpinelinux.org/alpine/v$alpine_ver/community >>/etc/apk/repositories
|
||||
# 先检查原来的repo是不是egde
|
||||
if grep -x 'http.*/edge/main' /etc/apk/repositories; then
|
||||
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
|
||||
}
|
||||
|
||||
|
12
trans.sh
12
trans.sh
@ -30,9 +30,15 @@ error_and_exit() {
|
||||
}
|
||||
|
||||
add_community_repo() {
|
||||
if ! grep -x 'http.*/community' /etc/apk/repositories; then
|
||||
alpine_ver=$(cut -d. -f1,2 </etc/alpine-release)
|
||||
echo http://dl-cdn.alpinelinux.org/alpine/v$alpine_ver/community >>/etc/apk/repositories
|
||||
# 先检查原来的repo是不是egde
|
||||
if grep -x 'http.*/edge/main' /etc/apk/repositories; then
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user