hustmirror-cli is a CLI posix shell script to replace system repository mirror to HUST Mirror.
- Alpine Linux
- Anolis OS
- Arch Linux
- Black Arch
- crates
- Debian
- Deepin
- Kali
- LinuxMint
- openEuler
- openKylin
- pypi
- Rustup
- Ubuntu
- Oh My Zsh
If you would to request supports of new Linux distributions or software, please submit an issue.
curl -s https://mirrors.hust.edu.cn/get | sh -s -- autodeploy
See details about hustmirror-cli usage in the USAGE.md.
Use GNU make to process all files and generate them
into a single executable bash.
makeThe output script will be placed in ./output/hustmirror-cli
make test- Syntax of scripts is supposed to POSIX shell compatible.
- Use 4 character tab indent.
- We suppose that user only install
GNU coreutilsorbusybox. So prerequisite check is supposed to be made when use other utils likegccormake.
- src: scripts would packaging into output scripts.
- src/mirrors: scripts subject to mirror script contract.
- src/main.sh.template: template shell file.
- src/checkfile.sh: check file.
- scripts: store scripts used for packaging.
Template file supports following directives:
@include file: include other files.@var(shell code): get a string from build process.@mirrors: include all processed mirror scripts.
All files in mirror should implement following functions.
check: (optional) check if target machine is satisfied to replace mirror.install: install mirror.is_deployed: (optional) check whether is deployed.can_recover: (optional) check whether can be recovered.uninstall: (optional) recover installation.