Skip to content

Instantly share code, notes, and snippets.

@annalinneajohansson
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save annalinneajohansson/6c8eafa28991dbd7dafc to your computer and use it in GitHub Desktop.

Select an option

Save annalinneajohansson/6c8eafa28991dbd7dafc to your computer and use it in GitHub Desktop.
Bash script to autostart dropbox daemon if it exists with a delay set in seconds. Usage $ dropbox <time in seconds>.
#!/bin/bash
## How long to delay the start of Dropbox
DELAY=$1
## If no delay is set default to 10 seconds
: ${DELAY:=10}
## If dropbox exists then start it
if type "dropbox" > /dev/null; then
echo "Starting Dropbox in ${DELAY} seconds..."
sleep $DELAY
dropbox start -i
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment