Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- function banner_simple() {
- local msg="* $* *"
- local edge=`echo "$msg" | sed 's/./*/g'`
- echo "$edge"
- echo "`tput bold`$msg`tput sgr0`"
- echo "$edge"
- echo
- }
- banner_simple "Preparing to mount Amazon S3 bucket"
- sudo apt install -y s3fs
- read -ep "What is the S3 access key? " ACCESS_KEY
- read -ep "What is the S3 secret key? " SECRET_KEY
- read -ep "What is the S3 bucket name? " BUCKET_NAME
- echo "$ACCESS_KEY":"$SECRET_KEY" > ~/.passwd-s3fs
- chmod 600 ~/.passwd-s3fs
- mkdir ~/s3-drive
- echo "Mounting S3 $BUCKET_NAME bucket at ~/s3-drive, please wait..."
- echo
- s3fs "$BUCKET_NAME" ~/s3-drive
- if [ mount | grep -q s3fs ]; then
- echo `tput setaf 2`Mount Successfull`tput sgr0`
- else
- echo `tput setaf 1`Mount Failed`tput sgr0`
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement