Import version as of 2011-08-11 for ftp-addkey.sh
authorunknown <sysadmin@gnu.org>
Thu, 11 Aug 2011 20:29:27 +0000 (15:29 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Wed, 29 Jul 2020 03:06:54 +0000 (22:06 -0500)
ftp-addkey.sh [new file with mode: 0755]

diff --git a/ftp-addkey.sh b/ftp-addkey.sh
new file mode 100755 (executable)
index 0000000..6be3215
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+# Adds a specified user & their key to the maintainer keyring on 
+# ftp.gnu.org.
+#
+
+PACKAGES=/home/gatekpr/packages
+
+if  ( ([ "$1" = "" ]) || ([ "$2" = "" ]) || ([ "$3" = "" ]) )
+then
+        echo "ftp-addkey.sh <project name> <maintainer email> <public key>"
+        exit
+fi
+
+if ! [ -d $PACKAGES/$1 ]
+then
+  echo "$1 is a new package. Creating a directory for it."
+  mkdir $PACKAGES/$1
+fi
+
+# Add email address to list of maintainers
+
+echo "Adding $2 to maintainer list."
+echo $2 >> $PACKAGES/$1/email
+
+# Import keys
+
+echo "Adding key..."
+
+pgpg $1 --import $3
+
+chmod -R 755 $PACKAGES/$1
+
+echo "Done."
+