3 if expr $# "<" "1" > /dev
/null
; then
4 echo "Usage: csig <file.c>"
8 echo "********* " $1 "*********"
11 echo $1 "no such file :("
15 if gpg
--verify $1; then
16 echo "*** already signed, and verifiable- doing nothing"
21 grep HEADER
: $0 |
grep -v grep |
sed -e s
/HEADER
://g
> /tmp
/csig.plain
23 cat /tmp
/csig.plain |
wc -l > /tmp
/header_size
25 head -n `expr \`cat /tmp
/header_size\
` + 4` $1 |
tail -n `cat /tmp/header_size` > /tmp
/diff_one
27 if `diff /tmp/csig.plain /tmp/diff_one > /dev/null`; then
28 echo "*** ok, resigning"
30 grep TAIL
: $0 |
grep -v grep |
sed -e s
/TAIL
://g
> /tmp
/tail
31 cat /tmp
/tail |
wc -l > /tmp
/tail_size
32 expr `cat /tmp/tail_size` + 8 > /tmp
/tail_size
35 tail +`expr \`cat /tmp
/header_size\
` + 5` $1 > /tmp
/strip0
38 cat /tmp
/strip0 |
wc -l > /tmp
/strip_size
39 head -n `expr \` cat /tmp
/strip_size\
` - \`cat /tmp
/tail_size\
`` /tmp
/strip0
> /tmp
/strip
42 echo "*** ok, signing new file"
46 cat /tmp
/strip
>> /tmp
/csig.plain
47 grep TAIL
: $0 |
grep -v grep |
sed -e s
/TAIL
://g
>> /tmp
/csig.plain
48 if ! gpg
--default-key $DEFAULT_KEY --armor --output /tmp
/csig.sign
--clearsign /tmp
/csig.plain
; then
49 echo "*** couldn't sign for some reason (probably doesn't have the private key), aborting"
50 rm -rf /tmp
/csig.plain \
63 echo "/*" > /tmp
/strip
64 cat /tmp
/csig.sign
>> /tmp
/strip
65 echo "*/" >> /tmp
/strip
68 rm -rf /tmp
/csig.plain \
80 HEADER
: m m mm mmm .
----------. .
---------------------. mmm mm m m
81 HEADER
: 8 8 88 888 | .
--------` | .------------------` 888 88 8 8
82 HEADER
: 8 8 88 888 |
```````|`V
```````| |``||``|`````|
888 88 8 8
83 HEADER
: 8 8 88 888 `------ | | [] | |``````|| | [] | 888 88 8 8
84 HEADER: 8 8 88 888 |`````` | | | ````|```` | | 888 88 8 8
85 HEADER: ` ` `` ``` ``````````````> |
````````````| |
`` ``` `` ` `
86 HEADER: ==============` `---`
87 HEADER
: L A B O R A T O R I E S
89 HEADER
:This
file is part of Hacker Radio Rec.
91 HEADER
:Hacker Radio Rec is free software
: you can redistribute it and
/or
92 HEADER
:modify it under the terms of the GNU General Public License as
93 HEADER
:published by the Free Software Foundation
, either version
3 of
94 HEADER
:the License or
(at your option
) any later version.
96 HEADER
:Hacker Radio Rec is distributed
in the hope that it will be
97 HEADER
:useful
, but WITHOUT ANY WARRANTY
; without even the implied
98 HEADER
:warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
99 HEADER
:See the GNU General Public License
for more details.
101 HEADER
: Copyright
(C
) 2009, Thea DeSilva
102 HEADER
: You can
find a copy of GNU General Public License
in COPYING
106 TAIL
: Thank you
for your attention