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 | f083272356417be74a5864d5ef6cfb1878558826 (patch) | |
tree | 6a489c787c073e4b4bc2b722759c098899bfea15 /docker/auto-backup/install-coscli.bash | |
parent | fc2b0e84cc359e45c09e81135702babc2284dfb1 (diff) | |
download | crupest-f083272356417be74a5864d5ef6cfb1878558826.tar.gz crupest-f083272356417be74a5864d5ef6cfb1878558826.tar.bz2 crupest-f083272356417be74a5864d5ef6cfb1878558826.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 |