Advertisement
tolikpunkoff

detectfs

Mar 25th, 2019
712
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ -z "$1" ]; then
  4.     blkid |sed -n 's/\(.*:\).* TYPE=\"\([^\"]*\)\".*/\1\2/p'
  5. else
  6.     RES=`blkid "$1"`
  7.     RC=$?
  8.     if [ $RC -ne 0 ];then
  9.     echo "$1:Not found or not supported (code $RC)"
  10.     else
  11.     RES=`echo "$RES"|sed -n 's/\(.*:\).* TYPE=\"\([^\"]*\)\".*/\1\2/p'`
  12.     if [ -n "$RES" ];then
  13.         echo "$RES"
  14.     else
  15.         echo "$1: Not exist TYPE"
  16.     fi
  17.     fi
  18. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement