Skip to main content

Thread: Help writing a bash script that will start Dropbox once a volume is mounted


hi,

need write bash script start dropbox once volume dropbox folder mounted. basically, i've dropbox folder inside truecrypt volume. i've set truecrypt run on boot , i've switched off "start dropbox on system start-up"

essentially, i've truecrypt volume at:
/dev/sdb1

mounts location at:
/mount/truecrypt1

location of dropbox folder at:
/mount/truecrypt1/dropbox

i've bash script set runs after login says
code:
#!/bin/sh truecrypt --mount /dev/sdb1 /media/truecrypt1
what want add script such check every second or 2 until device/drive mounted , start dropbox.

there batch file in windows this. works fine, want suggestions how might translated bash ubuntu.

code:
@echo off rem every second, check see if volume mounted echo waiting volume... :keepwaiting ping -n 1 -w 1000 127.0.0.1 > nul if not exist d:\ goto keepwaiting start "dropbox" "c:\documents , settings\yourusername\application data\dropbox\bin\dropbox.exe"
any appreciated!

try this

code:
#!/bin/bash  dbox_dir=/media/truecrypt1/dropbox while true   if [ -d "$dbox_dir" ]       echo dropbox folder ready     break   else     echo dropbox folder not available   fi   sleep 2 done  echo dropbox stuff here dropbox
i know nothing dropbox (what exact name of executable, there params required) need figure out last part. echo commands , else part of if block not required - testing purposes


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] Help writing a bash script that will start Dropbox once a volume is mounted


Ubuntu

Comments

Popular posts from this blog

Joomal 3.6.3 update error - PHP temporary folder is not set - Joomla! Forum - community, help and support

Upgrade 3.4.8 to 3.5.1 failed "download package failed" - Joomla! Forum - community, help and support

Fatal error during instalation - Joomla! Forum - community, help and support