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

local domain variable

parent 0616d0dc
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ SUBJECT=
MESSAGE=
COMPLETION_FILE=/root/${PROJECT_NAME}-completed.txt
notification_script=/tmp/xsend
local_domain=$HOSTNAME
function kill_xsend_process {
# Sometimes the process can get stuck, so ensure that
......@@ -81,7 +82,7 @@ if [ ! "$ADMIN_USERNAME" ]; then
fi
if [ ! "$ADMIN_EMAIL_ADDRESS" ]; then
ADMIN_EMAIL_ADDRESS=${ADMIN_USERNAME}@${HOSTNAME}
ADMIN_EMAIL_ADDRESS=${ADMIN_USERNAME}@${local_domain}
fi
notification_image_filename=/tmp/notification.jpg
......@@ -125,13 +126,13 @@ fi
if [ -d /etc/prosody ]; then
notification_user_password=$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c 30 ; echo -n '')
if prosodyctl register "notification" "$HOSTNAME" "$notification_user_password"; then
if prosodyctl register "notification" "$local_domain" "$notification_user_password"; then
{ echo '#!/usr/bin/python2';
echo 'import sys,os,xmpp,time';
echo 'tojid = sys.argv[1]';
echo 'data = sys.stdin.readlines()';
echo "msg = ' '.join(data)";
echo "username = 'notification@$HOSTNAME'";
echo "username = 'notification@$local_domain'";
echo "password = sys.argv[2]";
echo 'jid=xmpp.protocol.JID(username)';
echo 'cl=xmpp.Client(jid.getDomain(),debug=[])';
......@@ -159,7 +160,7 @@ if [ -d /etc/prosody ]; then
#kill_xsend_process
fi
prosodyctl deluser "notification@$HOSTNAME"
prosodyctl deluser "notification@$local_domain"
fi
if [ -f $notification_image_filename ]; then
......
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