On Thu, Mar 11, 2010 at 09:05:09PM +0100, Thomas Pfaff wrote:
> On Thu, 11 Mar 2010 14:27:29 +0200
> Alexey Vatchenko <[email protected]> wrote:
> 
> > Hi!
> > I wrote a little utility to easily mount plugged removable disks.
> > It's a kind of plugin for hotplugd(8).
> >
> [...]
> 
> Since we're on the subject, maybe I should share my attach script.
> It mounts the newly inserted device at the next free /mnt/umassN
> which must of course exist.  It starts an xterm with the cwd set
> to the mount point and unmounts the device when the xterm closes.
> 
> Anyone else with more fancy scripts that would like to share?

prompt user for softraid0 crypto passphrase, and mount it
...
   SanDisk*Crypto*)
      # SanDisk Cruzer, encrypted
      DISPLAY=":0.0" su user -c RunningX || exit 1
      PW=$(DISPLAY=":0.0" su user -c /usr/X11R6/bin/ssh-askpass) || exit 1
      TMPFILE=$(mktemp /tmp/bioctl.XXXXXXXXXX) || exit 1
      echo $PW > $TMPFILE
      bioctl -c C -p $TMPFILE -l /dev/"$DEVNAME"a softraid0
      rm -P $TMPFILE
      ;;
   SR*CRYPTO*)
      mount -o nodev,nosuid /dev/"$DEVNAME"a /mnt/crypto
      ;;


http://www.fiction.net/blong/programs/mutt/autoview/RunningX.c

Reply via email to