summaryrefslogtreecommitdiff
path: root/sys/lib/dist/pc/inst/isfossil
blob: 21c7d3e299c8ec60e07c7300c8144fd6d693db5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/rc

if(! ~ $#* 1){
	echo 'usage: isfossil /dev/sdC0/part' >[1=2]
	exit usage
}

arg=$1
if(! cmp -s <{dd -quiet 1 -if $arg -bs 1024 -iseek 127 |
	dd -quiet 1 -bs 14 -count 1} <{echo 'fossil config'})
	exit noconfig
if(! cmp -s <{dd -quiet 1 -if $arg -bs 1024 -iseek 128 |
	dd -quiet 1 -bs 4 -count 1 | xd -b | sed 1q} <{echo '0000000  37 76 ae 89'})
	exit notwritebuffer
exit 0