chiark / gitweb /
debman: With a version of debget that supports file: via curl, using it is
[bin.git] / write-sig
1 #! /bin/sh
2
3 # Get name of signature group
4 NAME=
5
6 # .signature file
7 SIGFILE=~/.signature
8
9 # Process arguments
10 while [ $# -ne 0 ]; do
11         case $1 in
12           -n|--name)
13                 NAME=$2
14                 shift 2
15                 ;;
16           -s|--sigfile)
17                 SIGFILE=$2
18                 shift 2
19                 ;;
20           *)    shift
21                 ;;
22         esac
23 done
24
25 # Clean up and exit on SIGHUP, SIGINT, SIGQUIT, or SIGTERM
26 trap "rm -f $SIGFILE; get-sig $NAME > $SIGFILE; exit 1" 1 2 3 15
27
28 rm -f $SIGFILE
29 mkfifo $SIGFILE
30 while :; do
31         get-sig $NAME > $SIGFILE
32 done