mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-10 11:24:33 +08:00
修改切换 linux 镜像源
This commit is contained in:
@@ -218,15 +218,15 @@ export default class SystemService {
|
||||
...oDoc,
|
||||
info: { ...oDoc.info, ...info },
|
||||
});
|
||||
let defaultDomain = 'https://dl-cdn.alpinelinux.org';
|
||||
let targetDomain = 'https://dl-cdn.alpinelinux.org';
|
||||
let defaultDomain = 'http://deb.debian.org';
|
||||
let targetDomain = 'http://deb.debian.org';
|
||||
if (os.platform() !== 'linux') {
|
||||
return;
|
||||
}
|
||||
const content = await fs.promises.readFile('/etc/apk/repositories', {
|
||||
const content = await fs.promises.readFile('/etc/apt/sources.list', {
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
const domainMatch = content.match(/(http.*)\/alpine\/.*/);
|
||||
const domainMatch = content.match(/(http.*)\/debian /);
|
||||
if (domainMatch) {
|
||||
defaultDomain = domainMatch[1];
|
||||
}
|
||||
@@ -239,7 +239,7 @@ export default class SystemService {
|
||||
)}/${targetDomain.replace(
|
||||
/\//g,
|
||||
'\\/',
|
||||
)}/g' /etc/apk/repositories && apk update -f`;
|
||||
)}/g' /etc/apt/sources.list && apt update`;
|
||||
|
||||
this.scheduleService.runTask(
|
||||
command,
|
||||
|
||||
Reference in New Issue
Block a user