Permalink
Browse files

Update script to use multiple repos

  • Loading branch information...
1 parent 1e5559d commit 85e6dd8b18e9a7cb43d6da572dace2dd76e38f33 @richo richo committed Mar 19, 2012
Showing with 14 additions and 3 deletions.
  1. +14 −3 sign.sh
View
17 sign.sh
@@ -1,5 +1,16 @@
#!/bin/sh
-su richo -c "gpg -abs -o ~/Release.gpg /var/repo/apt/dists/sid/Release"
-mv ~richo/Release.gpg /var/repo/apt/dists/sid/Release.gpg
-chown root:root /var/repo/apt/dists/sid/Release.gpg
+if [ -z "$1" ]; then
+ echo "Usage: ./sign.sh REPO_CODENAME [signing user]">&2
+ exit 1
+fi
+
+user=""
+[ -n "$SUDO_USER" ] &&
+ user=$SUDO_USER
+[ -n "$2" ] &&
+ user=$2
+
+su $user -c "gpg -abs -o ~/Release.gpg /var/repo/apt/dists/$1/Release"
+mv ~$user/Release.gpg /var/repo/apt/dists/$1/Release.gpg
+chown root:root /var/repo/apt/dists/$1/Release.gpg

0 comments on commit 85e6dd8

Please sign in to comment.