diff --git a/debrepo b/debrepo index 35d6bd0..61ae423 100755 --- a/debrepo +++ b/debrepo @@ -28,7 +28,12 @@ if [ "$1" = "list" ] || [ "$1" = "-l" ] || [ "$1" = "--list" ]; then exit fi -if [ "$1" = "serve" ] || [ "$1" = "-s" ] ||[ "$1" = "--serve" ]; then +if [ "$1" = "sign" ] || [ "$1" = "-s" ] || [ "$1" = "--sign" ]; then + $DIR/scripts/gpgSign.sh $2 + exit +fi + +if [ "$1" = "serve" ] || [ "$1" = "-S" ] ||[ "$1" = "--serve" ]; then python3 -m http.server exit fi diff --git a/scripts/gpgSign.sh b/scripts/gpgSign.sh old mode 100644 new mode 100755 index 409aadd..fa08211 --- a/scripts/gpgSign.sh +++ b/scripts/gpgSign.sh @@ -1,5 +1,8 @@ #!/bin/sh -# This is INSECURE! -cat ~/tmprepo/apt-repo/dists/stable/Release | gpg --default-key example -abs > ~/tmprepo/apt-repo/dists/stable/Release.gpg -cat ~/tmprepo/apt-repo/dists/stable/Release | gpg --default-key example -abs --clearsign > ~/tmprepo/apt-repo/dists/stable/InRelease +KEY="$1" + +echo "debrepo: signing using $KEY" + +cat ./apt-repo/dists/stable/Release | gpg --default-key $KEY -abs > ./apt-repo/dists/stable/Release.gpg +cat ./apt-repo/dists/stable/Release | gpg --default-key $KEY -abs --clearsign > ./apt-repo/dists/stable/InRelease