- #! /bin/bash
- file=$1
- while read line
- do
- name=$(echo $line | cut -d ":" -f 1)
- id=$(echo $line | cut -d ":" -f 2)
- em=$(ssh zhuohual@9.125.13.61 "lsvdisk -nohdr -filtervalue vdisk_UID=$id"</dev/null)
- vdisk_name=$(echo $em | awk -F " " '{print $2}')
- echo $vdisk_name
- echo "Delete $vdisk_name ($name)? "
- read ans <&1
- if [ $ans == 'y' ]; then
- `ssh zhuohual@9.125.13.61 "rmvdisk -force $vdisk_name"</dev/null`
- fi
- done <$file
数据来源:
hdisk5:600507680280838EC8000000000008E5
hdisk10:600507680280838EC80000000000089D
hdisk8:600507680280838EC80000000000089C
hdisk6:600507680280838EC800000000000899
hdisk3:600507680280838EC800000000000728
hdisk7:600507680280838EC80000000000089B
阅读(1985) | 评论(0) | 转发(0) |