summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/getvaliddaemons.php3
-rwxr-xr-xscripts/jabberqueuehandler.php20
-rwxr-xr-xscripts/publicqueuehandler.php20
-rwxr-xr-xscripts/startdaemons.sh14
-rwxr-xr-xscripts/xmppconfirmhandler.php20
-rwxr-xr-xscripts/xmppdaemon.php22
6 files changed, 50 insertions, 49 deletions
diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php
index 198ea8fb9..97c230784 100755
--- a/scripts/getvaliddaemons.php
+++ b/scripts/getvaliddaemons.php
@@ -38,9 +38,6 @@ if(common_config('xmpp','enabled')) {
echo "xmppdaemon.php jabberqueuehandler.php publicqueuehandler.php ";
echo "xmppconfirmhandler.php ";
}
-if(common_config('memcached','enabled')) {
- echo "memcachedqueuehandler.php ";
-}
if(common_config('twitterbridge','enabled')) {
echo "twitterstatusfetcher.php ";
}
diff --git a/scripts/jabberqueuehandler.php b/scripts/jabberqueuehandler.php
index a44993236..5b581629d 100755
--- a/scripts/jabberqueuehandler.php
+++ b/scripts/jabberqueuehandler.php
@@ -20,13 +20,13 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-$shortoptions = 'r::';
-$longoptions = array('resource::');
+$shortoptions = 'i::';
+$longoptions = array('id::');
$helptext = <<<END_OF_JABBER_HELP
Daemon script for pushing new notices to Jabber users.
- -r --resource Jabber Resource ID (default to config)
+ -i --id Identity (default none)
END_OF_JABBER_HELP;
@@ -63,16 +63,16 @@ if (common_config('xmpp','enabled')==false) {
exit();
}
-if (have_option('r')) {
- $resource = get_option_value('r');
-} else if (have_option('--resource')) {
- $resource = get_option_value('--resource');
+if (have_option('i')) {
+ $id = get_option_value('i');
+} else if (have_option('--id')) {
+ $id = get_option_value('--id');
} else if (count($args) > 0) {
- $resource = $args[0];
+ $id = $args[0];
} else {
- $resource = null;
+ $id = null;
}
-$handler = new JabberQueueHandler($resource);
+$handler = new JabberQueueHandler($id);
$handler->runOnce();
diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php
index 58ecc1745..701d50e01 100755
--- a/scripts/publicqueuehandler.php
+++ b/scripts/publicqueuehandler.php
@@ -20,13 +20,13 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-$shortoptions = 'r::';
-$longoptions = array('resource::');
+$shortoptions = 'i::';
+$longoptions = array('id::');
$helptext = <<<END_OF_PUBLIC_HELP
Daemon script for pushing new notices to public XMPP subscribers.
- -r --resource Jabber Resource ID
+ -i --id Identity (default none)
END_OF_PUBLIC_HELP;
@@ -61,16 +61,16 @@ if (common_config('xmpp','enabled')==false) {
exit();
}
-if (have_option('r')) {
- $resource = get_option_value('r');
-} else if (have_option('--resource')) {
- $resource = get_option_value('--resource');
+if (have_option('i')) {
+ $id = get_option_value('i');
+} else if (have_option('--id')) {
+ $id = get_option_value('--id');
} else if (count($args) > 0) {
- $resource = $args[0];
+ $id = $args[0];
} else {
- $resource = null;
+ $id = null;
}
-$handler = new PublicQueueHandler($resource);
+$handler = new PublicQueueHandler($id);
$handler->runOnce();
diff --git a/scripts/startdaemons.sh b/scripts/startdaemons.sh
index a44362b57..9ead20acd 100755
--- a/scripts/startdaemons.sh
+++ b/scripts/startdaemons.sh
@@ -20,23 +20,27 @@
# This program tries to start the daemons for Laconica.
# Note that the 'maildaemon' needs to run as a mail filter.
-ARGS=
+ARGSG=
+ARGSD=
if [ $# -gt 0 ]; then
- ARGS="$ARGS -s$1"
+ ARGSG="$ARGSG -s$1"
+ ID=`echo $1 | sed s/\\\\./_/g`
+ ARGSD="$ARGSD -s$1 -i$ID"
fi
if [ $# -gt 1 ]; then
- ARGS="$ARGS -p$2"
+ ARGSD="$ARGSD -p$2"
+ ARGSG="$ARGSG -p$2"
fi
DIR=`dirname $0`
-DAEMONS=`php $DIR/getvaliddaemons.php $ARGS`
+DAEMONS=`php $DIR/getvaliddaemons.php $ARGSG`
for f in $DAEMONS; do
printf "Starting $f...";
- php $DIR/$f $ARGS
+ php $DIR/$f $ARGSD
printf "DONE.\n"
done
diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php
index 883934fd6..d6821ddef 100755
--- a/scripts/xmppconfirmhandler.php
+++ b/scripts/xmppconfirmhandler.php
@@ -20,13 +20,13 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-$shortoptions = 'r::';
-$longoptions = array('resource::');
+$shortoptions = 'i::';
+$longoptions = array('id::');
$helptext = <<<END_OF_JABBER_HELP
Daemon script for pushing new confirmations to Jabber users.
- -r --resource Jabber Resource ID (default to config)
+ -i --id Identity (default none)
END_OF_JABBER_HELP;
@@ -147,17 +147,17 @@ if (common_config('xmpp','enabled')==false) {
exit();
}
-if (have_option('r')) {
- $resource = get_option_value('r');
-} else if (have_option('--resource')) {
- $resource = get_option_value('--resource');
+if (have_option('i')) {
+ $id = get_option_value('i');
+} else if (have_option('--id')) {
+ $id = get_option_value('--id');
} else if (count($args) > 0) {
- $resource = $args[0];
+ $id = $args[0];
} else {
- $resource = null;
+ $id = null;
}
-$handler = new XmppConfirmHandler($resource);
+$handler = new XmppConfirmHandler($id);
$handler->runOnce();
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php
index 661631937..3eecfec29 100755
--- a/scripts/xmppdaemon.php
+++ b/scripts/xmppdaemon.php
@@ -20,13 +20,13 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-$shortoptions = 'r::';
-$longoptions = array('resource::');
+$shortoptions = 'i::';
+$longoptions = array('id::');
$helptext = <<<END_OF_XMPP_HELP
Daemon script for receiving new notices from Jabber users.
- -r --resource Jabber Resource ID (default to config)
+ -i --id Identity (default none)
END_OF_XMPP_HELP;
@@ -52,7 +52,7 @@ class XMPPDaemon extends Daemon
}
if ($resource) {
- $this->resource = $resource;
+ $this->resource = $resource . 'daemon';
} else {
$this->resource = common_config('xmpp', 'resource') . 'daemon';
}
@@ -323,16 +323,16 @@ if (common_config('xmpp','enabled')==false) {
exit();
}
-if (have_option('r')) {
- $resource = get_option_value('r');
-} else if (have_option('--resource')) {
- $resource = get_option_value('--resource');
+if (have_option('i')) {
+ $id = get_option_value('i');
+} else if (have_option('--id')) {
+ $id = get_option_value('--id');
} else if (count($args) > 0) {
- $resource = $args[0];
+ $id = $args[0];
} else {
- $resource = null;
+ $id = null;
}
-$daemon = new XMPPDaemon($resource);
+$daemon = new XMPPDaemon($id);
$daemon->runOnce();