Hey there,
I have found a "problem" with the script (and this is a fresh install of the OS). Since my first post, I have reinstalled the entire OS and I am still getting the same problem.
Apparently, some rows contain a * in the SQL request, causing the while loop to fail:
mysql -ENB -u $DBUSER -p$DBPASS -h $DBHOST $DBNAME -e \
"SELECT if(type='extension',CONCAT('USER/',exten),device) AS channel,type,if(type<>'trunk',exten,' ') AS extension,\
label,mailbox,context,'$QUEUECONTEXT' as queuecontext,concat('*',mailbox) AS extenvoicemail, \
privacy,\`group\`,IF(type='trunk',IF(email<>'',concat('splitme-',email),''),email) as email, \
queuechannel,originatechannel FROM fop2buttons WHERE device<>'' ORDER BY type,exten" | \
sed '/\*\*/d' | sed 's/: /=/g' | sed '/.*=$/d' | while read LINEA
If the line is a *, then it will parse the files in the directoy, like so:
SIP/100
extension
100
Main Line
from-internal
from-queue
autobuttons.cfg autobuttons.cfg.~1~ autobuttons.cfg.~2~ autobuttons.cfg.~3~ autoconfig-buttons-freepbx.sh autoconfig-buttons-freepbx.sh.~1~ autoconfig-buttons-freepbx.sh.~2~ autoconfig-buttons-freepbx.sh.~3~ autoconfig-users-freepbx.sh autoconfig-users-freepbx.sh.~1~ autoconfig-users-freepbx.sh.~2~ autoconfig-users-freepbx.sh.~3~ buttons.cfg.sample buttons.cfg.sample.~1~ buttons.cfg.sample.~2~ buttons.cfg.sample.~3~ extensions_override_freepbx.conf extensions_override_freepbx.conf~ FOP2Callbacks.pm FOP2Callbacks.pm.sample FOP2Callbacks.pm.sample.~1~ FOP2Callbacks.pm.sample.~2~ fop2.cfg fop2.cfg.new fop2_server op_lang_de.cfg op_lang_de.cfg~ op_lang_en.cfg op_lang_en.cfg~ op_lang_es.cfg op_lang_es.cfg~ op_lang_fr_FR.cfg op_lang_fr_FR.cfg~ op_lang_it.cfg op_lang_it.cfg~ op_lang_pt_BR.cfg op_lang_pt_BR.cfg~ op_lang_zh.cfg op_lang_zh.cfg~
none
Now, I added a sed 's/\*/ /' before the while, but the buttons are still not showing up in the interface. I don't know exactly what it's supposed to look like (the final output) so it's hard to figure out what's wrong with the output I get. Could you enlighten me?
This is the actual output from the SQL request, without the sed:
SIP/100
extension
100
Main Line
from-internal
from-queue
*
none