2 # ~/.config/fsniper/scripts/encfs-automount.sh
3 # Quick & dirty script for automounting EncFS USB drives
7 ASKPASS
="/usr/lib/git-core/git-gui--askpass"
9 lock
=/tmp
/fsniper_encfs.lock
10 lpid
=$
(cat "$lock" 2>/dev
/null
) &&
11 ps
"$lpid" |
grep "$lpid" >/dev
/null
&& {
12 echo "Another instance of fsniper_encfs is running"
15 echo $BASHPID > "$lock";
19 echo ==== EncFS automount
script for fsniper
====
22 cat /proc
/mounts | cut
-d ' ' -f 2
25 list_mounts |
while read mount
; do
26 config
="$mount"'/*/.encfs*';
27 echo Looking
for "$config"
28 config
="$(echo $config)"
30 cyphertext
="$(dirname "$config")";
31 plaintext
="$cyphertext".plain
32 echo Found config
: "$config";
33 echo Trying to mount
: "$cyphertext to $plaintext";
34 list_mounts |
grep "$plaintext" >/dev
/null
&& {
35 echo Already mounted
: "$plaintext"
37 echo WOOHOO Will mount
"$cyphertext to $plaintext"
38 "$ASKPASS" "EncFS $cyphertext to $plaintext" | encfs
--stdinpass "$cyphertext" "$plaintext"
44 rm "$lock" 2>/dev
/null
This page took 0.255034 seconds and 4 git commands to generate.