We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
echo "$result" | grep " sd" | awk -v nlun="$lun" '{print nlun" "$2" "$3}'
The text was updated successfully, but these errors were encountered:
https://blog.csdn.net/weixin_35401836/article/details/116624892
Sorry, something went wrong.
#!/bin/bash tmpfile=/root/multipath_tmp [ -e "$tmpfile" ] && rm -rf $tmpfile function explain_one_foreach () { for lun in $(cat "$WWIDS" | grep -v ^# | sed s#/##g); do result=$(multipath -ll "$lun" 2> /dev/null) echo "$result" | grep " sd" | awk -v nlun="$lun" '{print nlun" "$3" "$2" "$5" "$6" "$7}' >> $tmpfile done } function explain_all () { results=$(multipath -ll 2> /dev/null) lun="" echo "$results" | while read line; do if [ "${line:0:2}" == "36" ]; then lun=$(echo $line | awk '{print $1}') fi if [ $(echo $line | grep -c " sd") -eq 1 ]; then echo "$line" | awk -v nlun="$lun" '{print nlun" "$3" "$2" "$5" "$6" "$7}' fi done } WWIDS=/etc/multipath/wwids if [ ! -f /etc/multipath/wwids ]; then echo "/etc/multipath/wwids files not existed" if [ $(multipath -ll 2>&1 | grep -c "DM multipath kernel driver not loaded") -eq 1 ]; then echo "DM multipath kernel driver not loaded" exit 1 fi fi explain_all >> $tmpfile exit 0
No branches or pull requests
The text was updated successfully, but these errors were encountered: