From f9f2dbfd4094ec9371fea6d11ad90ea099d9e39a Mon Sep 17 00:00:00 2001 From: illiliti Date: Tue, 11 May 2021 12:49:29 +0300 Subject: [PATCH] device-helper: move /dev/disk/by- to create_symlink() --- device-helper | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/device-helper b/device-helper index d1eca65..94b16ca 100755 --- a/device-helper +++ b/device-helper @@ -4,13 +4,13 @@ create_symlink() { - dir="$1"; sym="$2" + typ="$1"; sym="$2" sym="${sym%\"}" sym="${sym#\"}" - sym="${dir}/${sym}" + sym="/dev/disk/by-${typ}/${sym}" - mkdir -p "$dir" + mkdir -p "${sym%/*}" ln -s "../../${dev_name}" "$sym" } @@ -37,8 +37,8 @@ while ! _blkid=$(blkid "/dev/${dev_name}"); do fi done -for line in $_blkid; do case "${line%%=*}" in - UUID) create_symlink /dev/disk/by-uuid "${line##*=}" ;; - LABEL) create_symlink /dev/disk/by-label "${line##*=}" ;; - PARTUUID) create_symlink /dev/disk/by-partuuid "${line##*=}" ;; +for line in $_blkid; do case "${line%%=*}" in + UUID) create_symlink uuid "${line##*=}" ;; + LABEL) create_symlink label "${line##*=}" ;; + PARTUUID) create_symlink partuuid "${line##*=}" ;; esac; done