SHARE
TWEET

Untitled

a guest Apr 22nd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env bash
  2.  
  3. function banner_simple() {
  4.   local msg="* $* *"
  5.   local edge=`echo "$msg" | sed 's/./*/g'`
  6.   echo "$edge"
  7.   echo "`tput bold`$msg`tput sgr0`"
  8.   echo "$edge"
  9.   echo
  10. }
  11.  
  12. banner_simple "Preparing to mount Amazon S3 bucket"
  13.  
  14. sudo apt install -y s3fs
  15.  
  16. read -ep "What is the S3 access key? " ACCESS_KEY
  17. read -ep "What is the S3 secret key? " SECRET_KEY
  18. read -ep "What is the S3 bucket name? " BUCKET_NAME
  19.  
  20. echo "$ACCESS_KEY":"$SECRET_KEY" > ~/.passwd-s3fs
  21. chmod 600 ~/.passwd-s3fs
  22.  
  23. mkdir ~/s3-drive
  24.  
  25. echo "Mounting S3 $BUCKET_NAME bucket at ~/s3-drive, please wait..."
  26. echo
  27. s3fs "$BUCKET_NAME" ~/s3-drive
  28.  
  29. if [ mount | grep -q s3fs ]; then
  30.   echo `tput setaf 2`Mount Successfull`tput sgr0`
  31. else
  32.   echo `tput setaf 1`Mount Failed`tput sgr0`
  33. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top