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
what want add script such check every second or 2 until device/drive mounted , start dropbox.code:#!/bin/sh truecrypt --mount /dev/sdb1 /media/truecrypt1
there batch file in windows this. works fine, want suggestions how might translated bash ubuntu.
any appreciated!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"
try this
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 purposescode:#!/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
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
Post a Comment