From 2dabe2e92f3e65b849f37e21f89df81cefe5e213 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 May 2017 18:05:46 +0100 Subject: [PATCH] Handle multiple gpg keys --- src/freedombone-app-xmpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index f1ef59e6..d8a1b96f 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -208,7 +208,7 @@ function add_user_xmpp { if [ ! -d /home/$new_username/.config/profanity ]; then mkdir -p /home/$new_username/.config/profanity fi - GPG_PUBLIC_KEY_ID=$(su -c "gpg --list-keys $new_username@$HOSTNAME | grep 'pub '" - $new_username | awk -F ' ' '{print $2}' | awk -F '/' '{print $2}') + GPG_PUBLIC_KEY_ID=$(su -c "gpg --list-keys $new_username@$HOSTNAME | grep 'pub '" - $new_username | head -n 1 | awk -F ' ' '{print $2}' | awk -F '/' '{print $2}') echo "[${new_username}@${HOSTNAME}]" > $XMPP_CLIENT_ACCOUNTS echo 'enabled=true' >> $XMPP_CLIENT_ACCOUNTS echo "jid=${new_username}@${HOSTNAME}" >> $XMPP_CLIENT_ACCOUNTS