#!/bin/sh

WORKDIR=$(
  cd "$(dirname "$0")" || exit
  pwd
)
FILE="$WORKDIR/update-center.json"
rm "$FILE"
wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json -O "$FILE"
sed -i "s/http:\/\/updates.jenkins-ci.org\/download\//https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins\//g" "$FILE"
sed -i "s/http:\/\/www.google.com\//https:\/\/www.baidu.com\//g" "$FILE"
date +"%Y-%m-%d %H:%M:%S %Z" > "$WORKDIR/update_time.txt"
