Mgrctl is a utility that is used for performing operations with a control panel and calling its functions from the command line. The default location of the utility is /usr/local/mgr5/sbin/mgrctl.
/usr/local/mgr5/sbin/mgrctl [-m <manager>] [-u | -i [lang=<language>] | -l | [[-o <output format>] [-R | <funcname> [[<param>=<value>] ...]] [[-e ‘<param>=$<ENV_NAME>’] ...]]]
-m
-i — brief information about the functions of the control panel. If the function
-o
-l — suspend a control panel. The panel is suspended with the function exit. It cannot be restarted.
-u — resume the control panel that has been suspended with the -l key.
-R — restart the control panel before the function is executed.
=
-e ‘=$
Retrieve a list of all Web-domains
/usr/local/mgr5/sbin/mgrctl -m ispmgr webdomain | sed 's/=/ /' | awk '{print $2}'
A list of all Web-domains that belong to the certain user
/usr/local/mgr5/sbin/mgrctl -m ispmgr webdomain su=<user> | sed 's/=/ /' | awk '{print $2}'
Update all domains on external name servers
for i in $(/usr/local/mgr5/sbin/mgrctl -m ispmgr webdomain | awk '{print $1}' | awk -F = '{print $2}'); do /usr/local/mgr5/sbin/mgrctl -m ispmgr domain.fix elid=$i; done
Disable PHP for all WWW-domains
for i in $(/usr/local/mgr5/sbin/mgrctl -m ispmgr webdomain | awk '{print $1}' | awk -F = '{print $2}'); do /usr/local/mgr5/sbin/mgrctl -m ispmgr webdomain.edit php=off elid=$i sok=ok; done