-
Notifications
You must be signed in to change notification settings - Fork 106
/
dropbox.sh
41 lines (32 loc) · 698 Bytes
/
dropbox.sh
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
#!/bin/bash
# plugin to set "dropbox" proxy settings for ProxyMan
# privileges has to be set by the process which starts this script
DROPBOX_PY="dropbox"
list_proxy() {
echo
echo "${blue} Dropbox doesn't show proxy settings. No worries! ${normal}"
}
unset_proxy() {
$DROPBOX_PY proxy none &> /dev/null
}
set_proxy() {
eval "$DROPBOX_PY proxy manual http $http_host $http_port $username $password &> /dev/null"
}
which $DROPBOX_PY &> /dev/null
if [ "$?" != 0 ]; then
exit
fi
if [ "$#" = 0 ]; then
exit
fi
what_to_do=$1
case $what_to_do in
set) set_proxy
;;
unset) unset_proxy
;;
list) list_proxy
;;
*)
;;
esac