[sf-lug] Writing a wrapper script

Jeff Bragg jackofnotrades at gmail.com
Fri Jun 15 14:58:32 PDT 2012

The trivial wrapper script will encapsulate all of the options, so you can
just pass in arguments.  So $1 and $2 will be interpolated to the first two
arguments (foo and bar from the example).  So you'd call it like
"myscript.sh foo bar", and it would call encryptfs-simple with those two
arguments and the whole set of options specified in the example.  It's not
really based on regular expressions, just variables.

On Fri, Jun 15, 2012 at 1:14 PM, James Sundquist
<sundquistjames at gmail.com>wrote:

> The following is a script<https://bbs.archlinux.org/viewtopic.php?id=142328>for dealing with encrypted partitions.  What I'm curious about is the last
> section on creating "a trivial wrapper script" in order to avoid inputting
> options.  I'd love some clarification on how this works using regular
> expressions.  I don't plan to use the intended ecryptfs-simple, but I'd
> love to wrap my own scripts.  Thanks!
>> Enter ecryptfs-simple<http://xyne.archlinux.ca/projects/ecryptfs-simple/>.
>> It lets a regular user mount any encrypted directory on any other directory
>> as long as the user has full access permissions on both. It also prevents
>> mounting on top of mount points and unmounting non-eCryptfs mount points.
>> The usage is as simple as it gets:
>> # mount foo on bar
>> ecryptfs-simple foo bar
>> # unmount bar
>> ecryptfs-simple bar
>> # mount foo on bar with options to skip most of the mount helper dialogue (options can be found in "man ecryptfs")
>> ecryptfs-simple foo bar key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_enable_filename_crypto=y
>> That's it.
>> If you don't want to pass the options every time, write a trivial wrapper
>> script with your own options. Using the above example:
>> #!/bin/sh
>> ecryptfs-simple "$1" "$2" key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_enable_filename_crypto=y
>> ------------------------------
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug
> Information about SF-LUG is at http://www.sf-lug.org/

There Are More Than Two Ways To Do It
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxmafia.com/pipermail/sf-lug/attachments/20120615/987ee1fc/attachment.html>

More information about the sf-lug mailing list