Skip to content

Instantly share code, notes, and snippets.

@virtualstaticvoid
Created December 19, 2013 14:10
Show Gist options
  • Select an option

  • Save virtualstaticvoid/8039640 to your computer and use it in GitHub Desktop.

Select an option

Save virtualstaticvoid/8039640 to your computer and use it in GitHub Desktop.
Run multiple Dropbox accounts at once on Ubuntu
#!/bin/bash
if [ -z "$1" ]
then
echo "No dropbox profile specified" >&2
echo "Usage: $(basename "$0") profile command" >&2
exit 1
fi
fold="$1"
shift
while [ "$fold" != "${fold/%\//}" ]
do
fold="${fold/%\//}"
done
if [ "$fold" = "." ]
then
echo "Cannot use $fold as profile" >&2
exit 1
fi
HOME="$HOME/.$fold"
if [ ! -d "$HOME" ]
then
mkdir -p "$HOME"
if [ $? -ne 0 ]
then
echo "An error occurred while creating profile directory" >&2
exit 1
fi
fi
dropbox "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment