X7ROOT File Manager
Current Path:
/usr/lib/udev
usr
/
lib
/
udev
/
📁
..
📄
accelerometer
(60.82 KB)
📄
ata_id
(48.06 KB)
📄
cdrom_id
(56.09 KB)
📄
collect
(31.54 KB)
📄
fc_wwpn_id
(1.1 KB)
📁
hwdb.d
📄
kdump-udev-throttler
(1.41 KB)
📄
mtd_probe
(10.9 KB)
📄
phys-port-name-gen
(1.18 KB)
📄
rename_device
(15.04 KB)
📁
rules.d
📄
scsi_id
(56.86 KB)
📄
udev-kvm-check
(15.12 KB)
📄
v4l_id
(23.3 KB)
Editing: fc_wwpn_id
#!/bin/bash # # fc_wwpn_id # # Generates device node names links based on FC WWPN # Copyright (c) 2016 Hannes Reinecke, SUSE Linux GmbH # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation version 2 of the License. # DEVPATH=$1 SCSIPATH=$(cd -P "/sys$DEVPATH/device" || exit; echo "$PWD") d=$SCSIPATH [ -d "$d/scsi_disk" ] || exit 0 target_lun=${d##*:} while [ -n "$d" ] ; do d=${d%/*} e=${d##*/} case "$e" in rport*) rport=$e rport_dir="/sys/class/fc_remote_ports/$rport" if [ -d "$rport_dir" ] ; then rport_wwpn=$(cat "$rport_dir/port_name") fi ;; host*) host=$e host_dir="/sys/class/fc_host/$host" if [ -d "$host_dir" ] ; then host_wwpn=$(cat "$host_dir/port_name") break; fi esac done if [ -n "$rport_wwpn" ] || [ -n "$host_wwpn" ] ; then echo "FC_TARGET_LUN=$target_lun" fi if [ -n "$rport_wwpn" ] ; then echo "FC_TARGET_WWPN=$rport_wwpn" fi if [ -n "$host_wwpn" ] ; then echo "FC_INITIATOR_WWPN=$host_wwpn" fi
Upload File
Create Folder