How to edit an Asterisk update script to exclude commerical updates?

Hi, very new here but wondering if there is a way to edit a script that I found given by p_lindheimer to update Admin modules in the command line.

sudo -u asterisk /var/lib/asterisk/bin/module_admin upgradeall

sudo -u asterisk /var/lib/asterisk/module_admin reload

When I run this in my test pbx it updates the 'commercial" repos.

no repos specified, using: [commercial,standard,extended] from last GUI settings

Up to date.

How can this script be modified to exclude the commercial repos? Any help would be appreciated, thanks!

Run sudo -u asterisk /var/lib/asterisk/module_admin

Read the instructions therein

All that returns is this:

Run sudo -u asterisk /var/lib/asterisk/module_admin
No such command ‘Run sudo -u asterisk /var/lib/asterisk/module_admin’ (type ‘cor e show help Run sudo’ for other possible commands)

and when I type what it says I get this:

-bash: core: command not found

Sorry if this is simple,this is not my strong suit.

Please help me help you. Where did you “run” the sudo -u command the last time. Please run it there again like so:

sudo -u asterisk /var/lib/asterisk/module_admin
! sudo -u asterisk /var/lib/asterisk/bin/module_admin  --repos extended,standard,unsupported upgradeall

perhaps ?

It should work from both the Asterisk CLI and bash due to a serendipitous way that asterisk’s ‘shell’ and bash’s ‘history’ interpret an initial "! " (note the space)

( @sschallau was unsure of the difference and I believe @tm1000 was (argumentatively :slight_smile: ) leading him up the wrong “path” :slight_smile: to his original post’s resolution )

1 Like

Sorry for the late reply, I wasn’t able to access my test server… but this works perfectly!

I appreciate the help! Where would I find documentation to learn this myself later?


@tm1000 Thank you for your help too!

It’s a little confusing



amportal a ma

will issue the same options ( your “documentation”)


amportal a ma --repos extended,standard,unsupported upgradeall

will fail, but

/var/lib/asterisk/bin/module_admin --repos extended,standard,unsupported upgradeall

will succeed, go figure, file a bug or be pragmatic :wink:

I actually got everything that I wanted to do working. I have an apache server hosting the script in a cron job which I can add to the servers using a wget. I’m not even out of high school so I would say thats pretty cool :wink: I really appreciate the help! My boss loves it.

1 Like