~ubuntuone-support/+junk/syncdaemon-perftest

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# This script sets the environment for the simple syncdaemon test
# Roman Yepishev

set -e

cd `dirname $0`

mkdir -p bin lib

if [ ! -f bin/dropbox ]; then
    echo "Downloading Dropbox CLI app"
    wget -O bin/dropbox "http://linux.dropbox.com/packages/dropbox.py"
    chmod +x bin/dropbox
fi

if [ ! -d ~/.dropbox-dist ]; then
    echo "Downloading Dropbox distribution"
    ARCH=`uname -m`
    if [ "$ARCH" == "x86_64" ]; then
        PLATFORM="x86_64"
    else
        PLATFORM="x86"
    fi
    wget -O /tmp/dropbox-dist.tar.gz "http://www.dropbox.com/download/?plat=lnx.$PLATFORM"
    tar xfz /tmp/dropbox-dist.tar.gz -C$HOME
fi

echo "Please don't forget to authorize dropbox for the first time:"
echo "~/.dropbox-dist/dropbox"

echo "Checking for txstatsd"

PYTHONPATH=$PWD/lib:$PYTHONPATH python -c "import txstatsd" || \
    bzr branch --use-existing-dir lp:txstatsd lib/

echo "Adding crontab"
crontab user-crontab

echo "Done"

cat README