[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: loading truecrypt from the command line



On 3/15/13, Sharon Kimble <skimble04@gmail.com> wrote:
> On 15/03/2013, Zenaan Harkness <zen@freedbms.net> wrote:
>> I dug up my old command line script wrapper for truecrypt.
>>
>> Haven't used it for a few years, so YMMV.
>>
>> Here it is:
>>
>> #!/bin/sh
>>
>> DRV=/home/ME/truecrypt-source
>> VOL=$DRV/data.tc
>> MNT=/media/truecrypt1
>>
>> truecrypt $VOL $MNT
>
> Zenaan.
> Your script now looks like this ;-
>
> #!/bin/sh
> # Zenaan Harkness, March 2013
>
> DRV=/usr/bin/truecrypt
> VOL=/home/boztu/Documents/bucket
> MNT=/media/truecrypt1
>
> truecrypt $VOL $MNT
>
> and is called from a bash_alias of  - alias tc='nohup truecrypt &' so
> that when its loaded I can just CTRL+c to come out and still leave
> truecrypt running.
>
> Thanks, this is the most elegant solution so far, but there may be others.
> :)

Wonderful, glad it works for you.

BTW, the DRV= variable was an indirection for a mount point, which in
my previous script I had an extra line just prior to "truecrypt $VOL
$MNT" which said something like:
gksudo mount $DRV

So, now, and in your script, this variable is not being used. You can
comment it out or delete it.

Alternatively, since it seems to be pointing to a binary, you could
replace "truecrypt $VOL $MNT" with:

$DRV $VOL $MNT

But in that case it would be better to replace DRV with RUN, PROG, or
as I use CMD (for command).

Here's how I would do your script above:
#!/bin/sh
VOL=/home/boztu/Documents/bucket
MNT=/media/truecrypt1
nohup truecrypt $VOL $MNT &

and then save the file as "tc" with executable permissions of course.
I don't know if "nohup ... &" works properly in a bash script... not
sure if you should need the & - probably better to remove that, since
I would not want it backgrounded until I had entered my password, and
that happens automatically when truecrypt command exits, I think.

cheers
zenaan


Reply to: