diff options
author | crupest <crupest@outlook.com> | 2022-11-23 19:22:37 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-11-23 19:22:37 +0800 |
commit | bdf21b39964a4a02ea41abfdd50cad708cd8ddc8 (patch) | |
tree | 6a489c787c073e4b4bc2b722759c098899bfea15 /docker/auto-backup/install-coscli.bash | |
parent | b22fd5f45317095dbf9f073557cac7abdcbee245 (diff) | |
download | crupest-bdf21b39964a4a02ea41abfdd50cad708cd8ddc8.tar.gz crupest-bdf21b39964a4a02ea41abfdd50cad708cd8ddc8.tar.bz2 crupest-bdf21b39964a4a02ea41abfdd50cad708cd8ddc8.zip |
Replace rclone with coscli.
Diffstat (limited to 'docker/auto-backup/install-coscli.bash')
-rwxr-xr-x | docker/auto-backup/install-coscli.bash | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docker/auto-backup/install-coscli.bash b/docker/auto-backup/install-coscli.bash new file mode 100755 index 0000000..d3a45b0 --- /dev/null +++ b/docker/auto-backup/install-coscli.bash @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +# Check I'm root. +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root" 1>&2 + exit 1 +fi + +download_url=$(curl -s https://api.github.com/repos/tencentyun/coscli/releases/latest | jq -r ".assets[] | select(.name | test(\"coscli-linux\")) | .browser_download_url") + +curl -L -o /coscli "$download_url" + +chmod +x /coscli + +/coscli --version |