Skip to content

Commit

Permalink
fix mirror 2
Browse files Browse the repository at this point in the history
  • Loading branch information
haobibo committed Jun 24, 2024
1 parent 7b6d1cc commit dce6a9e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions docker_atom/work/localize/run-config-mirror-aliyun-pub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
echo "Setup timezone, current date: $(date)"

eval "export $(cat /etc/os-release | grep ID=)" && export OS_ID=${ID} && echo "Found ${ID} system, setting mirror for ${ID}"
FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
FILE_YUM=$([ -f /etc/yum.repos.d/CentOS-Linux-BaseOS.repo ] && echo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo )

FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
if [ -f $FILE_DEB ]; then
sed -i 's/mirrors.*.com\/ubuntu/mirrors.aliyun.com\/ubuntu/' $FILE_DEB
sed -i 's/archive.ubuntu.com\/ubuntu/mirrors.aliyun.com\/ubuntu/' $FILE_DEB
Expand Down
3 changes: 1 addition & 2 deletions docker_atom/work/localize/run-config-mirror-aliyun-vpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
echo "Setup timezone, current date: $(date)"

eval "export $(cat /etc/os-release | grep ID=)" && export OS_ID=${ID} && echo "Found ${ID} system, setting mirror for ${ID}"
FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
FILE_YUM=$([ -f /etc/yum.repos.d/CentOS-Linux-BaseOS.repo ] && echo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo )

FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
if [ -f $FILE_DEB ]; then
sed -i 's/mirrors.*.com\/ubuntu/mirrors.cloud.aliyuncs.com\/ubuntu/' $FILE_DEB
sed -i 's/archive.ubuntu.com\/ubuntu/mirrors.cloud.aliyuncs.com\/ubuntu/' $FILE_DEB
Expand Down
3 changes: 1 addition & 2 deletions docker_atom/work/localize/run-config-mirror-tencent-pub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
echo "Setup timezone, current date: $(date)"

eval "export $(cat /etc/os-release | grep ID=)" && export OS_ID=${ID} && echo "Found ${ID} system, setting mirror for ${ID}"
FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
FILE_YUM=$([ -f /etc/yum.repos.d/CentOS-Linux-BaseOS.repo ] && echo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo )

FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
if [ -f $FILE_DEB ]; then
sed -i 's/mirrors.*.com\/ubuntu/mirrors.tencent.com\/ubuntu/' $FILE_DEB
sed -i 's/archive.ubuntu.com\/ubuntu/mirrors.tencent.com\/ubuntu/' $FILE_DEB
Expand Down
3 changes: 1 addition & 2 deletions docker_atom/work/localize/run-config-mirror-tencent-vpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
echo "Setup timezone, current date: $(date)"

eval "export $(cat /etc/os-release | grep ID=)" && export OS_ID=${ID} && echo "Found ${ID} system, setting mirror for ${ID}"
FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
FILE_YUM=$([ -f /etc/yum.repos.d/CentOS-Linux-BaseOS.repo ] && echo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo )

FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
if [ -f $FILE_DEB ]; then
sed -i 's/mirrors.*.com\/ubuntu/mirrors.tencentyun.com\/ubuntu/' $FILE_DEB
sed -i 's/archive.ubuntu.com\/ubuntu/mirrors.tencentyun.com\/ubuntu/' $FILE_DEB
Expand Down
3 changes: 1 addition & 2 deletions docker_atom/work/localize/run-config-mirror-tsinghua.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
echo "Setup timezone, current date: $(date)"

eval "export $(cat /etc/os-release | grep ID=)" && export OS_ID=${ID} && echo "Found ${ID} system, setting mirror for ${ID}"
FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
FILE_YUM=$([ -f /etc/yum.repos.d/CentOS-Linux-BaseOS.repo ] && echo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo )

FILE_DEB=$([ -f /etc/apt/sources.list.d/${OS_ID}.sources ] && echo /etc/apt/sources.list.d/${OS_ID}.sources || echo /etc/apt/sources.list )
if [ -f $FILE_DEB ]; then
sed -i 's/mirrors.*.com\/ubuntu/mirrors.tuna.tsinghua.edu.cn\/ubuntu/' $FILE_DEB
sed -i 's/archive.ubuntu.com\/ubuntu/mirrors.tuna.tsinghua.edu.cn\/ubuntu/' $FILE_DEB
Expand Down

0 comments on commit dce6a9e

Please sign in to comment.