Print empty disk list for unsupported OS
This commit is contained in:
		
					parent
					
						
							
								a8588019ee
							
						
					
				
			
			
				commit
				
					
						5314f514c5
					
				
			
		
					 1 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
#!/bin/sh -e
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
uname_s="$(uname -s)"
 | 
					uname_s="$(uname -s)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ case "${uname_s}" in
 | 
				
			||||||
            # https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
 | 
					            # https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
 | 
				
			||||||
            lsblk -e 1,2,11 -dno name | xargs
 | 
					            lsblk -e 1,2,11 -dno name | xargs
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            printf "%s operating system without lsblk is not supported, if you can please submit a patch\n" "${uname_s}" >&2
 | 
					            printf "Don't know how to list disks for %s operating system without lsblk, if you can please submit a patch\n" "${uname_s}" >&2
 | 
				
			||||||
            exit 1
 | 
					 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
    *)
 | 
					    *)
 | 
				
			||||||
        printf "%s operating system is not supported, if you can please submit a patch\n" "${uname_s}" >&2
 | 
					        printf "Don't know how to list disks for %s operating system, if you can please submit a patch\n" "${uname_s}" >&2
 | 
				
			||||||
        exit 1
 | 
					 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
esac
 | 
					esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					exit 0
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue