INIT Script for DropBox


#!/bin/bash

DROPBOX_USERS=”angus”
DROPBOX_CLIENT=”/usr/local/bin/dropbox.py”

RETVAL=0

dropbox() {
for dbuser in $DROPBOX_USERS; do
if [[ “$USER” -eq “$dbuser” ]]; then
“$DROPBOX_CLIENT” “$1”
else
su $dbuser -c “$DROPBOX_CLIENT $1”
fi
done
}

case “$1″ in
start)
dropbox start
;;
stop)
dropbox stop
;;
restart)
dropbox stop
dropbox start
;;
status)
dropbox status
;;
*)
echo $”Usage: $prog {start|stop|restart|status}”
RETVAL=3
esac
exit $RETVAL

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s