Created
January 25, 2023 16:32
-
-
Save duskvirkus/e7d924607ff76050d124a2ead70f9ef9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Installs s5cmd | |
if command -v s5cmd &> /dev/null | |
then | |
echo "s5cmd is already installed" | |
exit 0 | |
fi | |
START_DIR=$(pwd) | |
if [ $(id -u) != 0 ]; then | |
echo "this script must be run using sudo" | |
echo "" | |
echo "usage:" | |
echo "sudo "$0 | |
exit $exit_code | |
exit 1 | |
fi | |
# wget installed ? | |
if ! command -v wget &> /dev/null | |
then | |
echo "curl could not be found, installing" | |
apt install -y wget | |
fi | |
TMP_DIR=$(mktemp -d -t ci-XXXXXXXXXX) | |
cd $TMP_DIR | |
wget "https://github.com/peak/s5cmd/releases/download/v2.0.0/s5cmd_2.0.0_Linux-64bit.tar.gz" | |
tar -xf s5cmd_2.0.0_Linux-64bit.tar.gz | |
mv s5cmd /usr/local/bin | |
cd $START_DIR | |
rm -rf $TMP_DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment