<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[User Permissions]]></title><description><![CDATA[<p dir="auto">Hi.</p>
<p dir="auto">I have made a bash script that gets the users permissions from another file, the bash script works fine and the fop2.cfg file can execute it. However, the output configurations from my bash file aren't being applied to the configuration.</p>
<p dir="auto">Below is my bash script which prints out the new user permissions in the correct syntax</p>
<pre><code>#!/bin/bash
for USER in `cat /etc/asterisk/voicemail.conf | grep "=&gt;" | cut -d, -f1 | sed 's/ =&gt; /:/g'`
do
 echo "$USER" &gt; tmpUserFile
 USEREXT=`cat ./tmpUserFile | cut -d, -f1 | sed 's/ =&gt; /:/g' | cut -d: -f1`

 for CHKUSER in `cat ./manual-user-rights.cfg | cut -d: -f1`;
 do
  if [ "$USEREXT" == "$CHKUSER" ]
  then
    USERRIGHTS=`cat ./manual-user-rights.cfg | grep "$USEREXT" | cut -d: -f2`;
    echo "user=$USER:$USERRIGHTS";
  fi
 done

 rm -r ./tmpUserFile
done
echo "buttonfile=autobuttons.cfg"
</code></pre>
<p dir="auto">Perhaps some line issue with the echo? not recognizing the line break?</p>
<p dir="auto">Also can anybody tell me when the fop2.cfg is executed. Eg. is the configuration re-run when users log in, or does the fop2.cfg only re-run when the service is restarted?</p>
<p dir="auto">Cheers.</p>
]]></description><link>http://localhost:4567/topic/251/user-permissions</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 12:30:31 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/251.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Feb 2010 22:23:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to User Permissions on Tue, 02 Feb 2010 02:11:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">The "start, stop, restart" are only available on the init script, not on fop2_server itself. If the init script works fine, your #exec script will be executed. Remember that you have to set the execute permissions to your script too...</p>
<p dir="auto">Best regards,</p>
<p dir="auto">PS: I am online now, and will be online for one more hour.</p>
]]></description><link>http://localhost:4567/post/1158</link><guid isPermaLink="true">http://localhost:4567/post/1158</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Tue, 02 Feb 2010 02:11:55 GMT</pubDate></item><item><title><![CDATA[Reply to User Permissions on Tue, 02 Feb 2010 01:31:39 GMT]]></title><description><![CDATA[<p dir="auto">Still having the same problem as before, although I have cleaned up the code a bit.<br />
This is the revised code.</p>
<pre><code>#!/bin/bash

for EXTNO in `cat /etc/asterisk/voicemail.conf | grep "=&gt;" | cut -d, -f1 | sed 's/ =&gt; /:/g' | cut -d: -f1`
do

 for CHKNO in `cat ./manual-user-rights.cfg | cut -d: -f1`
 do

  if [ "$EXTNO" == "$CHKNO" ]
  then

   PERMISSIONS=`cat ./manual-user-rights.cfg | grep "$EXTNO" | cut -d: -f2`
   SECRET=`cat /etc/asterisk/voicemail.conf | grep "$EXTNO =&gt;" | cut -d, -f1 | sed 's/ =&gt; /:/g' | cut -d: -f2`

   echo "user=$EXTNO:$SECRET:$PERMISSIONS"

  fi

 done

done

echo "buttonfile=autobuttons.cfg"
</code></pre>
<p dir="auto">When I call the script directly it executes fine, with correct output. When I execute 'fop2_server restart'. It executes the script but the config from the script doesn't seem to be loading. When I execute 'service fop2 restart' the script doesn't even get executed.</p>
<p dir="auto">Output from the script when called directly:</p>
<pre><code>user=4006:4006:pickup
user=4003:4003:all
user=4256:4256:pickup,hangup,dial
buttonfile=autobuttons.cfg
</code></pre>
<p dir="auto">The format of 'manual-user-rights.cfg' is:</p>
<pre><code>ext:permissions
4003:all
4006:pickup
4256:pickup,hangup,dial
</code></pre>
<p dir="auto">It doesn't appear to be a file permission issue as I am using the default file. If I use the default script, It runs when 'service fop2 restart' and 'fop2_server restart' are executed whereas if I use my code, it only runs on 'fop2_server restart'</p>
<p dir="auto">Any help would be greatly appreciated</p>
]]></description><link>http://localhost:4567/post/1157</link><guid isPermaLink="true">http://localhost:4567/post/1157</guid><dc:creator><![CDATA[255]]></dc:creator><pubDate>Tue, 02 Feb 2010 01:31:39 GMT</pubDate></item><item><title><![CDATA[Reply to User Permissions on Mon, 01 Feb 2010 22:59:18 GMT]]></title><description><![CDATA[<p dir="auto">Can we please chat to you online???</p>
]]></description><link>http://localhost:4567/post/1156</link><guid isPermaLink="true">http://localhost:4567/post/1156</guid><dc:creator><![CDATA[255]]></dc:creator><pubDate>Mon, 01 Feb 2010 22:59:18 GMT</pubDate></item><item><title><![CDATA[Reply to User Permissions on Mon, 01 Feb 2010 22:58:41 GMT]]></title><description><![CDATA[<p dir="auto">Hi.</p>
<p dir="auto">The user secret and extension are both held in the $USER variable.</p>
<p dir="auto">Thanks about the reload info.</p>
]]></description><link>http://localhost:4567/post/1155</link><guid isPermaLink="true">http://localhost:4567/post/1155</guid><dc:creator><![CDATA[255]]></dc:creator><pubDate>Mon, 01 Feb 2010 22:58:41 GMT</pubDate></item><item><title><![CDATA[Reply to User Permissions on Mon, 01 Feb 2010 22:50:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">It seems your script is not writing the user secret ?</p>
<blockquote>
<p dir="auto">echo "user=$USER:<strong>Where_is_the_sercret?</strong>:$USERRIGHTS";</p>
</blockquote>
<p dir="auto">The script is executed every time you start or reload fop2_server . The reload is done by sending a HUP signal to the process.</p>
<p dir="auto">Best regards,</p>
]]></description><link>http://localhost:4567/post/1154</link><guid isPermaLink="true">http://localhost:4567/post/1154</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Mon, 01 Feb 2010 22:50:40 GMT</pubDate></item></channel></rss>