[sf-lug] Writing a wrapper script

James Sundquist sundquistjames at gmail.com
Fri Jun 15 13:14:01 PDT 2012


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
>
> ------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxmafia.com/pipermail/sf-lug/attachments/20120615/c31dd948/attachment.html>


More information about the sf-lug mailing list