-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew_dropbox
More file actions
executable file
·112 lines (87 loc) · 1.7 KB
/
new_dropbox
File metadata and controls
executable file
·112 lines (87 loc) · 1.7 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#! /bin/bash
dir=.dropbox-dist
remote=$1
if [[ $remote == *: ]]
then
remote=${remote%:}
check="ssh $remote"
if [[ $($check echo $SHELL) != /bin/tcsh ]]
then
echo "can't install to machine until you change your shell" >&2
exit 1
fi
if [[ -n $($check ls $dir 2>/dev/null) ]]
then
echo "won't install to a machine that already has Dropbox on it" >&2
exit 1
fi
arch=$($check uname -i)
case $arch in
*86_64) arch=x86_64
;;
*86) arch=x86
;;
*) echo "don't what kind of architecture your machine has ($arch)"
exit 1
;;
esac
echo "will install Dropbox $arch version"
echo -n "is this okay? [y/N] "
read yn
if [[ $yn != [yY]* ]]
then
exit
fi
scp ~/common/new_dropbox ~/bin/dropboxd $remote:
ssh $remote echo ~/$(basename $0) $arch \> .login
exec ssh $remote
fi
if [[ -d ~/$dir ]]
then
echo "Dropbox already installed; won't reinstall" >&2
exit 1
fi
arch=$1
case $arch in
x86) ;;
x86_64) ;;
*) echo "usage: $0 [x86|x86_64]" >&2
exit 2
;;
esac
cd ~
tarfile=dropbox.tar.gz
wget -O$tarfile "http://www.dropbox.com/download/?plat=lnx.$arch"
tar xvpzf $tarfile
mkdir $dir/lock
mkdir $dir/run
mkdir $dir/sysconfig
echo "DROPBOX_USERS=buddy" >$dir/sysconfig/dropbox
rm $tarfile
if [[ -x ./dropbox ]]
then
./dropbox start
/bin/rm -f ./dropbox
else
/bin/sh -c "/home/$USER/.dropbox-dist/dropboxd &"
fi
if [[ -r .login ]]
then
/bin/rm -f .login
fi
makeln=~/common/makeln
fix_perms=~/common/fix_perms
fortune=~/common/fortunes/buddy
until [[ -r $makeln && -r $fix_perms && -r $fortune ]]
do
echo "Waiting for makeln et al ..."
sleep 10
done
if [[ ! -x makeln ]]
then
source $fix_perms
fi
mkdir -p ~/local/fortunes ~/local/bin
cd ~/common
./makeln
/bin/rm -f $0