Last active
December 21, 2015 22:18
-
-
Save tinkerbotfoo/6373821 to your computer and use it in GitHub Desktop.
Install & configure Dropbox on Ubuntu 12.04 precise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/installs | |
cd ~/installs | |
wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86_64" | |
tar -xvzf dropbox.tar.gz | |
mv .dropbox-dist ~/.dropbox-dist | |
~/.dropbox-dist/dropboxd | |
#Go to the URL provided by the above command. | |
#It will ask for your dropbox username and password to authorize the newly install dropbox client on the ubuntu server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## Dropbox Initscript. | |
## Note : | |
# Create this file in the /etc/init.d and run the following commands | |
# sudo chmod +x /etc/init.d/dropbox | |
# sudo update-rc.d dropbox defaults | |
# sudo service dropbox start | |
# dropbox service | |
# Replace with linux users you want to run Dropbox clients for | |
DROPBOX_USERS="user1 user2" | |
DAEMON=.dropbox-dist/dropbox | |
start() { | |
echo "Starting Dropbox..." | |
for dbuser in $DROPBOX_USERS; do | |
HOMEDIR=`getent passwd $dbuser | cut -d: -f6` | |
if [ -x $HOMEDIR/$DAEMON ]; then | |
HOME="$HOMEDIR" start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $HOMEDIR/$DAEMON | |
fi | |
done | |
} | |
stop() { | |
echo "Stopping Dropbox..." | |
for dbuser in $DROPBOX_USERS; do | |
HOMEDIR=`getent passwd $dbuser | cut -d: -f6` | |
if [ -x $HOMEDIR/$DAEMON ]; then | |
start-stop-daemon -o -c $dbuser -K -u $dbuser -x $HOMEDIR/$DAEMON | |
fi | |
done | |
} | |
status() { | |
for dbuser in $DROPBOX_USERS; do | |
dbpid=`pgrep -u $dbuser dropbox` | |
if [ -z $dbpid ] ; then | |
echo "dropboxd for USER $dbuser: not running." | |
else | |
echo "dropboxd for USER $dbuser: running (pid $dbpid)" | |
fi | |
done | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart|reload|force-reload) | |
stop | |
start | |
;; | |
status) | |
status | |
;; | |
*) | |
echo "Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment