isfossil 385 B

12345678910111213141516
  1. #!/bin/rc
  2. if(! ~ $#* 1){
  3. echo 'usage: isfossil /dev/sdC0/part' >[1=2]
  4. exit usage
  5. }
  6. arg=$1
  7. if(! cmp -s <{dd -quiet 1 -if $arg -bs 1024 -iseek 127 |
  8. dd -quiet 1 -bs 14 -count 1} <{echo 'fossil config'})
  9. exit noconfig
  10. if(! cmp -s <{dd -quiet 1 -if $arg -bs 1024 -iseek 128 |
  11. dd -quiet 1 -bs 4 -count 1 | xd -b | sed 1q} <{echo '0000000 37 76 ae 89'})
  12. exit notwritebuffer
  13. exit 0