SHARE
TWEET

Create_Chrome_Profile_versioned.sh

a guest Apr 7th, 2011 523 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. PROFILE_NAME=$1
  4. mkdir -p "/Applications/Google Chrome $1.app/Contents/MacOS"
  5.  
  6. F="/Applications/Google Chrome $1.app/Contents/MacOS/Google Chrome $1"
  7. cat > "$F" <<\EOF
  8. #!/bin/bash
  9.  
  10. #
  11. # Google Chrome for Mac with additional profile.
  12. #
  13.  
  14. # Name your profile:
  15. EOF
  16.  
  17. echo "PROFILE_NAME='$PROFILE_NAME'" >> "$F"
  18.  
  19. cat >> "$F" <<\EOF
  20. # Store the profile here:
  21. PROFILE_DIR="/Users/$USER/Library/Application Support/Google/Chrome/${PROFILE_NAME}"
  22.  
  23. # Find the Google Chrome binary:
  24. CHOME_BIN="/Users/$USER/Applications/Google Chrome ${PROFILE_NAME}.app/Contents/MacOS/Google Chrome"
  25. if [[ ! -e "$CHOME_BIN" ]]; then
  26.   echo "ERROR: Can not find Google Chrome.  Exiting."
  27.   exit -1
  28. fi
  29.  
  30. # Start me up!
  31. exec "$CHOME_BIN" --enable-udd-profiles --user-data-dir="$PROFILE_DIR"
  32. EOF
  33.  
  34. sudo chmod +x "$F"
RAW Paste Data
Top