mybin

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

commit 902df9aaa71f09c0ce86ba7265e929b134cc8f8b
parent 9669b1014cf1c40f5931b25e522c441fb06d14c1
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Fri, 12 Aug 2016 02:09:18 +0200

duuid

Diffstat:
duuid | 21+++++++++++++++++++++
1 file changed, 21 insertions(+), 0 deletions(-)

diff --git a/duuid b/duuid @@ -0,0 +1,21 @@ +#!/bin/bash + +# get disk uuid from volume name + +VOLUME="$1" +FILE="$HOME/config/private/duuid" + +ID="$(grep "^$VOLUME " "$FILE" | cut -d' ' -f2)" + +if [[ -z "$ID" ]] +then + >&2 echo "no volume $VOLUME" + # just in case + echo "/dev/zero" + exit 2 +fi + +echo "/dev/disk/by-uuid/$ID" + +exit 0 +