mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit d87261fc748b37055e3997927a77dd6a266a140b
parent 084fbb4cb976a48c7f2a7e57901f3259043add36
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sun,  3 Nov 2024 19:25:03 +0100

fix

Diffstat:
luks_mount | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/luks_mount b/luks_mount @@ -4,7 +4,14 @@ set -e VOLUME="$1" MACHINE="$2" -if [ -z $MACHINE ] +# shift two parameters to have cryptsetup options after +if [ "$#" -ge 2 ]; then + shift 2 +else + shift 1 +fi + +if [ -z "$MACHINE" ] then COMMAND="" else @@ -22,9 +29,9 @@ fi if [ -f "$KEY" ] then - cat "$KEY" | $COMMAND sudo cryptsetup luksOpen --key-file=- "$ID" "$VOLUME" + cat "$KEY" | $COMMAND sudo cryptsetup luksOpen "$@" --key-file=- "$ID" "$VOLUME" else - $COMMAND sudo cryptsetup luksOpen "$ID" "$VOLUME" + $COMMAND sudo cryptsetup luksOpen "$@" "$ID" "$VOLUME" fi $COMMAND sudo mkdir -p "$FOLDER" $COMMAND sudo mount "/dev/mapper/$VOLUME" "$FOLDER"