Skip to content
Snippets Groups Projects
Commit 2dabe2e9 authored by Bob Mottram's avatar Bob Mottram
Browse files

Handle multiple gpg keys

parent 13d0998a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment