Skip to content

Commit e4050a2

Browse files
committed
fix sorting and permissions mode of vdev_id.conf
1 parent e04247b commit e4050a2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ubm/patch_vdev_id_conf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@
1111

1212
[ -z "$BASH" ] && echo "Must use bash" >&2 && exit 1
1313

14+
umask 022
15+
1416
SLOT_NAME=$1
1517
SLOT_DEV_BY_PATH=$2
1618

1719
VDEV_ID_CONF=/etc/vdev_id.conf
1820

1921
PATCHED_COMMENT_TAG="# Patched by $(realpath "$0") via /usr/lib/udev/rules.d/67-ubm.rules (or 68-0-custom-aliases.rules)"
2022

21-
[ -z "$SLOT_NAME" ] && perror "SLOT_NAME not given" && exit 0
22-
[ -z "$SLOT_DEV_BY_PATH" ] && perror "SLOT_DEV_BY_PATH not given" && exit 0
23+
[ -z "$SLOT_NAME" ] && echo "SLOT_NAME not given" >&2 && exit 0
24+
[ -z "$SLOT_DEV_BY_PATH" ] && echo "SLOT_DEV_BY_PATH not given" >&2 && exit 0
2325

2426
generate_vdev_id_conf() {
2527
local TMPFILE
@@ -60,7 +62,7 @@ generate_vdev_id_conf() {
6062

6163
# sort entries, keeping comments on top
6264
sed -i 's/#/\x0/g' "$TMPFILE"
63-
sort -o "$TMPFILE" "$TMPFILE"
65+
sort --version-sort -o "$TMPFILE" "$TMPFILE"
6466
sed -i 's/\x0/#/g' "$TMPFILE"
6567

6668
mv "$TMPFILE" "$VDEV_ID_CONF"

0 commit comments

Comments
 (0)