ejabberd - Comments for "ejabberdctl-extra - Additional Commands for ejabberdctl" https://www.ejabberd.im/ejabberdctl-extra en Allow spaces in nickname of contact https://www.ejabberd.im/ejabberdctl-extra#comment-51948 <p>So I changed ejabberdctl and added " " quotes around both instances of $@.</p> <p>This has worked so far, but I haven't tested all the commands, just vcard-set and add-rosteritem</p> <p>When trying to use ejabberdctl2 as you wrote, I got errors trying to connect to a different server. (Running ejabberdctl to control a remote server)</p> Thu, 06 Mar 2008 00:19:46 +0000 Jason comment 51948 at https://www.ejabberd.im ejabberdctl script argument processing https://www.ejabberd.im/ejabberdctl-extra#comment-2273 <p>simple test.</p> <p>$ cat ./erlp<br /> #!/usr/bin/perl<br /> # dump arguments one per line.<br /> print join("\n", @ARGV),"\n";</p> <p>$ cat ./ejabberdctl<br /> #!/bin/sh<br /> # call argument dumper 'erlp'<br /> exec ./erlp -noinput -sname ejabberdctl -s ejabberd_ctl -extra $@</p> <p>$ ./ejabberdctl ejabberd2@localhost add-rosteritem badlop localhost bob localhost "'Bob Smith'" workers both<br /> -noinput<br /> -sname<br /> ejabberdctl<br /> -s<br /> ejabberd_ctl<br /> -extra<br /> ejabberd2@localhost<br /> add-rosteritem<br /> badlop<br /> localhost<br /> bob<br /> localhost<br /> 'Bob<br /> Smith'<br /> workers<br /> both</p> <p>problem is in argument expansion. need '"' around $@</p> <p>$ cat ./ejabberdctl_fix<br /> #!/bin/sh<br /> # call argument dumper 'erlp'<br /> # added '"' around $@<br /> exec ./erlp -noinput -sname ejabberdctl -s ejabberd_ctl -extra "$@"</p> <p>$ ./ejabberdctl_fix ejabberd2@localhost add-rosteritem badlop localhost bob localhost "'Bob Smith'" workers both<br /> -noinput<br /> -sname<br /> ejabberdctl<br /> -s<br /> ejabberd_ctl<br /> -extra<br /> ejabberd2@localhost<br /> add-rosteritem<br /> badlop<br /> localhost<br /> bob<br /> localhost<br /> 'Bob Smith'<br /> workers<br /> both</p> Sat, 16 Sep 2006 08:49:54 +0000 zengargoyle comment 2273 at https://www.ejabberd.im ejabberdctl2/roster issues https://www.ejabberd.im/ejabberdctl-extra#comment-2269 <p>I changed my ejabberdctl script to reflect the changes you mentioned and that works fine. Now I have created a bash script to modify all of the user's rosters so the names show as a regular name instead of the usernames. If I only run the single line as you did above it works fine, but when I run it for each user one after another the aliases keep disappearing for the previous users. So for example:</p> <p>I run: ./ejabberdctl2 ejabberd2@localhost add-rosteritem badlop localhost bob localhost "'Bob Smith'" workers both</p> <p>Then I would run: ./ejabberdctl2 ejabberd2@localhost add-rosteritem paul localhost badlop localhost "'badlop lastname'" workers both</p> <p>But when it is run that second time it fills out the roster perfectly for the user paul, but it removes the previously added alias for paul on the badlop user's profile. So what ends up happening is the last user in my bash script has all the aliases correctly displayed.. but the first user in the bash script has none of them. Of course all the users in between have a progressively larger and larger list of correct aliases as you get towards the end of the bash script. Here is the script I'm using to do this.. but it happens whether I use the script or not.</p> <p>ANY help would really be appreciated.. hope some of this makes sense to you all.</p> <p>#!/bin/bash</p> <p># combined.txt is in the form: john.smith "'John Smith'" Tech<br /> # with each user being on it's own separate line</p> <p># Cycle through the # of users as read from the file<br /> for (( j = 1; j &lt;= `wc -l combined.txt |awk '{print $1}'`; j++ ))<br /> do</p> <p># grab $j line in file and assign username to variable<br /> username=`cat -n combined.txt |grep $j -m 1 |awk '{print $2}'`</p> <p>echo "Modifying roster for:" $username</p> <p> for (( k = 1; k &lt;= `wc -l combined.txt |awk '{print $1}'`; k++))<br /> do</p> <p> # assign username, full name and department to variables<br /> nametoadd=`cat -n combined.txt |grep $k -m 1 |awk '{print $2}'`<br /> nameinquotes=`cat -n combined.txt |grep $k -m 1 |awk '{print $3 " " $4}'`<br /> department=`cat -n combined.txt |grep $k -m 1 |awk '{print $5}'`</p> <p> ./ejabberdctl2 "ejabberd@localhost add-rosteritem $username server.domain.com $nametoadd server.domain.com $nameinquotes $department none"</p> <p> echo "...added:" $nametoadd<br /> done<br /> done</p> Thu, 14 Sep 2006 23:03:44 +0000 frielp comment 2269 at https://www.ejabberd.im Try this custom script https://www.ejabberd.im/ejabberdctl-extra#comment-1944 <p>I forgot to mention that I don't use the script on tools/ejabberdctl, but by own script. When I tried with the default one, it failed as you mention.</p> <p>I don't know where lies the problem exactly, but try it.</p> <p>For reference, this experiment uses the default script:</p> <pre>$ cat ejabberdctl #!/bin/sh exec erl -noinput -sname ejabberdctl -s ejabberd_ctl -extra $@ $ ./ejabberdctl ejabberd2@localhost add-rosteritem badlop localhost bob localhost "'Bob Smith'" workers both Usage: ejabberdctl node command Available commands: ... </pre><p>and nothing is done on the roster.</p> <p>Using my custom script:</p> <pre>$ cat ejabberdctl2 #!/bin/bash sh -c "erl -noinput -sname ejabberdctl -s ejabberd_ctl -extra $1 $2 $3 $4 $5 $6 $7 $8 $9" $ ./ejabberdctl2 ejabberd2@localhost add-rosteritem badlop localhost bob localhost "'Bob Smith'" workers both $</pre><p>and the item is added to the roster.</p> <p>If you find a clue where exactly the problem is, please tell me.</p> Wed, 28 Jun 2006 16:08:12 +0000 mfoss comment 1944 at https://www.ejabberd.im Re: Two word (or more) nick names? https://www.ejabberd.im/ejabberdctl-extra#comment-1934 <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <p>I found it works for me with two different solutions:</p> <ul> <li>doble quotes inside simple quotes, example: '"John Jack"' </li><li>or simple quotes inside doble quotes, example: "'John Jack'" </li></ul> </div> <p>I tried what you suggested above and that didn't seem to work either. I am using ejabberd v1.1.1 on Slackware Linux 10.2 in case that makes any difference. Here is exactly what I am trying:</p> <ul> <li>./ejabberdctl ejabberd@server add-rosteritem first.last server.domain.com first.last server.domain.com "'John Smith'" Accounting none</li> <li>./ejabberdctl ejabberd@server add-rosteritem first.last server.domain.com first.last server.domain.com '"John Smith"' Accounting none</li> </ul> <p>Both of those don't work.. ejabberdctl just spits out the "usage" like I'm not using it correctly. If I just use one name like below it works fine:</p> <ul> <li>./ejabberdctl ejabberd@server add-rosteritem first.last server.domain.com first.last server.domain.com John Accounting none</li> </ul> <p>Thanks again for your help and for making this module. :)</p> Tue, 27 Jun 2006 18:09:03 +0000 frielp comment 1934 at https://www.ejabberd.im Re: Two word (or more) nick names? https://www.ejabberd.im/ejabberdctl-extra#comment-1916 <div class="quote-msg"> <div class="quote-author"><em>frielp</em> wrote:</div> <p>I have tried surrounding the nick with the following and none have helped: [ ], { }, " ", ' ', &lt; &gt;</p></div> <p>I found it works for me with two different solutions:</p> <ul> <li>doble quotes inside simple quotes, example: '"John Jack"' </li><li>or simple quotes inside doble quotes, example: "'John Jack'" </li></ul> Sun, 25 Jun 2006 09:30:06 +0000 mfoss comment 1916 at https://www.ejabberd.im Two word (or more) nick names? https://www.ejabberd.im/ejabberdctl-extra#comment-1906 <p>I installed this module and it seems to work fine except I want to use the "add-rosteritem" function to add nicknames to all of my users. The problem is I can't see how to add nick names with more than one word in them. I can add them fine if they are one word, but the minute I try to make it two words it just assumes the last name is a group. I can change the nick to two words from within Psi just fine but I am trying to do it from the command line so I can write a script to do it for all of my users. I have tried surrounding the nick with the following and none have helped: [ ], { }, " ", ' ', &lt; &gt;</p> <p>Any help would be appreciated!<br /> Thanks,<br /> Paul</p> Fri, 23 Jun 2006 16:38:15 +0000 frielp comment 1906 at https://www.ejabberd.im Re: About Adds more options for ejabberd_ctl https://www.ejabberd.im/ejabberdctl-extra#comment-1824 <div class="quote-msg"> <div class="quote-author"><em>flower</em> wrote:</div> <p>When I restart ejabberd, can't load the module. in the log file I found this:<br /> [Loading of /opt/ejabberd-1.1.1/lib/ejabberd-1.1.1/ebin/mod_ctlextra.beam failed: badfile],[beam/beam_load.c(1097): Error loading module mod_ctlextra:<br /> use of opcode 125; this emulator supports only up to 115]</p></div> <p>You probably compiled the module using Erlang R11B, but you try to use it on Erlang R10B, right? Make sure you compile the module with the same version that you later use. ejabberd is not yet tested with Erlang R11B, so you better use Erlang R10B-10.</p> Fri, 02 Jun 2006 08:57:33 +0000 mfoss comment 1824 at https://www.ejabberd.im You are using beam file for another Erlang version https://www.ejabberd.im/ejabberdctl-extra#comment-1823 <p>Hello,</p> <p>You are using beam files compiled with Erlang R11B on an older Erlang (probably R10B).<br /> You need to recompile from source on the target system.</p> <p>--<br /> Mickaël Rémond<br /> <noindex><a href="http://www.process-one.net" rel="nofollow" >Process-one</a></noindex></p> Fri, 02 Jun 2006 08:45:58 +0000 mremond comment 1823 at https://www.ejabberd.im About Adds more options for ejabberd_ctl https://www.ejabberd.im/ejabberdctl-extra#comment-1821 <p>I try to apply your steps to enable the new features that you added.<br /> But there is many problems. When I restart ejabberd, can't load the module. in the log file I found this:<br /> [Loading of /opt/ejabberd-1.1.1/lib/ejabberd-1.1.1/ebin/mod_ctlextra.beam failed: badfile],[beam/beam_load.c(1097): Error loading module mod_ctlextra:<br /> use of opcode 125; this emulator supports only up to 115]<br /> I would like to apply your module. Can you help me? can you explain farther? can you send me details steps. if you hava the compiled module, send it to me.</p> Thu, 01 Jun 2006 15:52:41 +0000 flower comment 1821 at https://www.ejabberd.im Chcngelog request https://www.ejabberd.im/ejabberdctl-extra#comment-1781 <p>Badlop,<br /> can you include changelog in this and the rest of your contributed modules (something similar to the one from mod_logxml for example), please.</p> Sun, 21 May 2006 18:18:48 +0000 Tomaso comment 1781 at https://www.ejabberd.im Apply patch on FreeBSD https://www.ejabberd.im/ejabberdctl-extra#comment-1219 <p>Thanks.. :D<br /> I apply the patch:</p> <p># make extract<br /> ===&gt; Vulnerability check disabled, database not found<br /> ===&gt; Extracting for ejabberd-0.9.8<br /> =&gt; MD5 Checksum OK for ejabberd-0.9.8.tar.gz.<br /> # cp ejabberdctl-extra.diff /usr/ports/net-im/ejabberd/work/ejabberd-0.9.8/src/<br /> # cd /usr/ports/net-im/ejabberd/work/ejabberd-0.9.8/src/<br /> # patch &lt; ejabberdctl-extra.diff<br /> Hmm... Looks like a unified diff to me...<br /> The text leading up to this was:<br /> --------------------------<br /> |Index: ejabberd_ctl.erl<br /> |===================================================================<br /> |--- ejabberd_ctl.erl (revisión: 444)<br /> |+++ ejabberd_ctl.erl (copia de trabajo)<br /> --------------------------<br /> Patching file ejabberd_ctl.erl using Plan A...<br /> Hunk #1 succeeded at 6 with fuzz 1.<br /> Hunk #2 succeeded at 192.<br /> Hunk #3 succeeded at 261.<br /> Hunk #4 succeeded at 499.<br /> Hunk #5 succeeded at 516.<br /> Hunk #6 succeeded at 584.<br /> done<br /> #</p> Thu, 05 Jan 2006 12:42:03 +0000 cajardim comment 1219 at https://www.ejabberd.im Re: How to use diff in the FreeBSD? https://www.ejabberd.im/ejabberdctl-extra#comment-1195 <p>Apply the patch to the ejabberd source code and compile.</p> Wed, 28 Dec 2005 08:52:15 +0000 mfoss comment 1195 at https://www.ejabberd.im How to use diff in the FreeBSD? https://www.ejabberd.im/ejabberdctl-extra#comment-1194 <p>I have ejabberd installed in a FreeBSD and I wanted to know as to activate this feature!</p> Tue, 27 Dec 2005 18:51:08 +0000 cajardim comment 1194 at https://www.ejabberd.im