use official FreeBSD sign.sh script

This commit is contained in:
Augustin FL 2022-12-31 16:58:34 +01:00 committed by GitHub
parent 925f95e38d
commit 1345e2098a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,22 +138,7 @@ openssl genrsa -out repo.key 2048
chmod 0400 repo.key
openssl rsa -in repo.key -out repo.pub -pubout
printf "function: sha256\nfingerprint: `sha256 -q repo.pub`\n" > fingerprint
```
Then create a script file `sign.sh` in the `/root/sign/` folder.
```
#!/bin/sh
read -t 2 sum
[ -z "$sum" ] && exit 1
echo SIGNATURE
echo -n $sum | openssl dgst -sign /root/sign/repo.key -sha256 -binary
echo
echo CERT
cat /root/sign/repo.pub
echo END
```
Finally, ensure that this script is executable:
```
curl -o /root/sign/sign.sh https://raw.githubusercontent.com/freebsd/pkg/master/scripts/sign.sh
chmod +x /root/sign/sign.sh
```