Astral 360 Astral Toolbox

Installation

One-line install, installer options, DNSOnly support, updates, and uninstall for Astral Toolbox.

Astral Toolbox installs on any cPanel/WHM server (full installs and DNSOnly nodes) running AlmaLinux. Everything runs as root.

Requirements

  • A cPanel/WHM (or cPanel DNSOnly) server — detected via /usr/local/cpanel/whostmgr/docroot/cgi/.
  • Root shell access.
  • Binaries: curl, unzip, sha256sum, install (all present on a stock cPanel install).
  • PHP CLI: the installer prefers cPanel's bundled interpreter /usr/local/cpanel/3rdparty/bin/php and only falls back to php on the PATH. No EasyApache/system PHP is required — this is what makes DNSOnly installs work (see DNSOnly notes).
  • Outbound HTTPS (port 443) to toolbox.cdn.astral360.com (the installer, the activation SDK and the release files) and to activation.astral360.com (enrolment, licence checks, download grants). The plugin keeps using both after the install.
  • Stable channel only: the ionCube loader in cPanel's PHP, because the stable build is ionCube-encoded. When it is missing, the installer adds ioncube to WHM → Tweak Settings → PHP loader (keeping any loader already listed), checks again, and stops if the loader is still not loaded. The dev channel is plaintext and skips this check.

Quick install

Run as root. Four flavours, depending on how much control you want:

# 1) One-liner, non-interactive (no TTY through the pipe). Installs the core
#    from the stable channel, with the bundled search-logs extension.
curl -fsSL https://toolbox.cdn.astral360.com/install.sh | bash

# 2) One-liner with extensions, installed and enabled after the core.
curl -fsSL https://toolbox.cdn.astral360.com/install.sh \
    | bash -s -- --extensions=server-monitoring,huge-file-check

# 3) Interactive: download, read it if you wish (less install.sh), then run.
#    After installing the core, the installer shows a checkbox menu of the
#    extensions this server may install (arrows navigate, Space toggles,
#    A all, N none, Enter confirms, Q skips).
curl -fsSL https://toolbox.cdn.astral360.com/install.sh -o install.sh
bash install.sh

# 4) Dev channel (plaintext build). Only for a server with Toolbox DEV access.
#    Add --extensions=... after it to get extensions in the same run.
curl -fsSL https://toolbox.cdn.astral360.com/install.sh | bash -s -- --channel=dev

Once finished, log in to WHM and look for Astral Toolbox in the sidebar (Plugins section).

Through a pipe (flavours 1, 2 and 4) the installer asks nothing: on the stable channel it enables the ionCube loader, and it removes a legacy v1 install, without asking. Run from a terminal (flavour 3), it asks first ([Y/n] for the loader, [Y/n] for the legacy removal; answering no stops the install), then shows the menu. -y gives the piped behaviour in a terminal.

The menu and --extensions only install what this server may install. Anything else is skipped with a line in the output (DEV-only without DEV access, not built for this channel, or a download the platform refuses), and the exit code stays 0. A paid extension is installed when the platform grants its download; without an active subscription or trial it then shows Licence needed and does not load.

Installer options

Flag Effect
--channel=stable\|dev Release channel. Default stable, the ionCube-encoded build. dev is the plaintext build and only succeeds on a server with Toolbox DEV access; otherwise the download is refused and the installer stops before extracting anything. On an installed server it also switches the channel the plugin follows (see Update channel).
--extensions=slug1,slug2 Install and enable these extensions after the core. Skips the menu. DEV-only extensions need DEV access; the others are skipped with a message. A paid extension is installed only if the platform grants its download, and without an active subscription or trial it then shows Licence needed and does not load. Listing search-logs is harmless (it is already in the core; it is downloaded again and enabled).
--non-interactive, -y Ask nothing: no menu, and the ionCube loader and the legacy removal are accepted without a prompt. Installs only the core unless --extensions is also given. Implicit when stdin is not a TTY (e.g. curl \| bash).
--no-autostart Do not write the /etc/cron.d/toolbox-auto-update cron (the scheduler's line is written all the same). An existing cron file is left as is, and the installer still runs one update pass at the end. To turn automatic updates off on an installed server, use Options → Version.
--verbose Also show on screen the output of every command the installer runs. Without it, that output only goes to /var/log/toolbox-install.log.
--help, -h Print usage. An unknown option prints the usage and exits with code 2. Options only take the --name=value form (--channel dev is refused).

Re-running the installer on a dev server? Pass --channel=dev again. Without it the installer extracts the stable build over the dev one (and needs the ionCube loader), while the plugin keeps following dev: the update pass at the end of the install switches the core back to the dev build when automatic updates are on; otherwise Options → Version shows Channel switch pending.

What the installer does

The installer prints one framed block per step, each action on its own line with Done in green or Failed in red, and writes the same lines, without colours, to /var/log/toolbox-install.log. It stops at the first step that fails and names its block.

It works in two stages. The published install.sh only does what must happen before anything from the plugin can be trusted:

  1. Checking the server: root, curl, unzip, sha256sum, install, the PHP command line, cPanel.
  2. ionCube loader (stable channel): checks it, and adds ioncube to WHM's PHP loader setting if needed.
  3. Activation SDK: downloads https://toolbox.cdn.astral360.com/pub/activation_client.txt and stops unless its SHA-256 matches the value pinned in install.sh.
  4. Downloading the core: enrols the server if it has no token yet (see Licence and DEV access), reads its DEV access, gets the RSA-signed manifest of the channel, and downloads toolbox-core.zip through a download grant, checking its SHA-256 against the signed manifest. Any failure here stops the install with nothing installed.
  5. Unpacking the core into a temporary folder, never over the live plugin.

It then hands over to the second stage, install/setup.sh, from the archive it has just verified. That script lives with the core, so it changes with each release:

  1. Previous installation: removes a legacy v1 install (asked first from a terminal), or notes the version of each bundled extension before an update.
  2. Installing the plugin files into /usr/local/cpanel/whostmgr/docroot/cgi/toolbox/. Its var/ folder (settings, licence state, caches) is never overwritten.
  3. Plugin settings: on a fresh install, writes var/state.json with the bundled extensions enabled and the chosen channel; an existing one is kept, and only --channel changes its channel.
  4. Registering the plugin with WHM: /usr/local/cpanel/bin/register_appconfig .../install/toolbox.conf, and the sidebar icon.
  5. Scheduled tasks: drops /etc/cron.d/toolbox-scheduler, the line that runs the extensions' jobs every minute (see Scheduled jobs below). Then, unless --no-autostart, /etc/cron.d/toolbox-auto-update, with a randomized minute and 4-hour cycle offset so a fleet of servers doesn't reach the platform simultaneously. Re-running the installer never overwrites an existing cron file (delete it first to re-randomize).
  6. Base extensions: runs the install steps (onInstall()) of each bundled extension, which comes with the core (Search Logs), in a block of its own.
  7. Requested extensions: from the menu or --extensions, each one in its own block, through the Store's own engine: download grant, SHA-256 against the signed manifest, archive structure (no absolute paths or .. escapes), a trial run beside the plugin, extraction into extensions/<slug>/, its install steps, then it is enabled. One that this server may not install is skipped with the reason.
  8. Permissions: sets the plugin tree to root:root and takes write access away from everyone else.
  9. First update check: one pass of cron/auto-update.php, which checks in, fills the version caches so the Version and Extensions tabs show real data right away and, with automatic updates on, installs any newer build.

install/setup.sh can also be run on its own, as root, from any whole plugin tree (a test server): bash setup.sh --from=<tree> --channel=dev. On a server already installed, its --channel changes the channel the plugin follows only when --channel-explicit is given too. It also takes --extensions, -y, --no-autostart, --verbose and --help. The code of each step lives in a file of its own under install/lib/.

Migrating from the legacy plugin

If /usr/local/cpanel/whostmgr/docroot/cgi/toolbox/ already hosts the older (v1) WHM-Toolbox, the installer detects it (absence of core/Kernel.php) and cleans it up before installing: the toolbox and toolbox2 AppConfig registrations, the toolbox-auto-update and toolbox-mail-scan cron drop-ins (and their toolbox2- versions), the cPanel resource-usage Perl hook, addon icons, and the plugin tree itself. Interactive runs prompt before removal; curl | bash runs and -y remove automatically. The removal happens once the new core is downloaded and verified, just before its files are laid: if the enrolment or the download fails, the v1 plugin stays as it was; if laying the new files fails, neither version is left on the server.

The v1 plugin's own WHM entry and crons have other names and stay in place; remove them by hand once the install is done:

/usr/local/cpanel/bin/unregister_appconfig log-whm_plugin_register
rm -f /var/cpanel/apps/log-whm_plugin_register.conf /etc/cron.d/toolbox-update-cron /etc/cron.d/toolbox-maildisk-cron

Servers installed from the old URL

Before core 2.0.20 the installer was published at https://static.astralinternet.com/WHM-Toolbox/install.sh. That URL still serves the old installer, which installs core 2.0.18 from the old static server, and it is being retired: do not use it for new installs.

A server installed from it runs core 2.0.18 (or older, if automatic updates were off), which looks for updates only on the old static server. That server offers nothing newer than 2.0.18, so these servers keep their version until Astral Internet publishes a transitional release on the old static server. A server still on the v1 plugin (no core/Kernel.php in its tree) is covered by Migrating from the legacy plugin instead.

To move one server now, run the new installer on it (flavour 1 or 3). Because the tree already has core/Kernel.php, it is upgraded in place: var/state.json, the *.user.json overrides and the cron schedule are kept; the server is enrolled; the core is replaced by the build of the chosen channel (stable unless --channel=dev; stable needs the ionCube loader); Store extensions already installed are updated by the update pass at the end of the install when this channel has a newer version and automatic updates are on, and otherwise stay as they are until their next version.

On a server that uses Mail Disk Space, Search And Replace or Mail Scanner, core 2.0.27 or later updates their old copies without Toolbox DEV access (before, they waited for it). The Mail Disk Space and Search And Replace copies from the old Store declare no channel: they keep running, and the Store and the automatic update replace them with the current versions once their licence is valid (free according to the Activation platform, or an active subscription or trial). A 0.1.0 Mail Scanner laid by hand stays locked (« Not available ») and connected to the mail server until an update replaces it, and an active subscription or trial is enough for that. Mail Scanner 0.1.1 or later also needs an active subscription or trial: without one and without DEV access, it stops loading and, after two checks at least 3 hours apart, gives mail back to cPanel's own spam filtering (its files and settings stay, and it comes back and reconnects once it has a licence; with no subscription at all, DEV access alone reconnects it too, but its pages stay locked).

If the enrolment or the download fails, the installer stops before extracting anything and the 2.0.18 install is left as it was. What stays: the ionCube loader setting (changed earlier) and, if the enrolment itself went through, the server's licence and /var/cpanel/toolbox/activation.json (ignored by 2.0.18, reused by the next attempt). Start with one server.

Security note

The one-liner trusts DNS + TLS to deliver an authentic install.sh. From there the chain is checked: the activation SDK must match the SHA-256 pinned in install.sh; the channel's manifest must carry a valid RSA signature, checked with the public key pinned for that channel (in install.sh and in the plugin), and must be built for that channel; each archive listed in that signed manifest must match its SHA-256 before it is extracted. Release files are only served through download grants to an enrolled server. If you operate in a hostile network where you don't trust DNS resolution, use flavour 3 (download, inspect, run).

Licence and DEV access

Astral Toolbox installs without a licence key. The installer enrols the server with the Astral Activation platform (https://activation.astral360.com/api/v1), and the plugin enrols it again by itself whenever it has no token.

  • What is sent: the server's IP (on NAT, the public IP from /var/cpanel/cpnat; otherwise the first IPv4 address ip a lists) and its machine ID (/etc/machine-id, else /var/lib/dbus/machine-id, else a random ID kept in the token file), plus the hostname, MAC address, OS name, cPanel version and number of cPanel accounts. The plugin also reports the installed core and extension versions and the channel it follows.
  • Where the token lives: /var/cpanel/toolbox/activation.json, root only (file 0600, directory 0700), outside the plugin directory. It also holds the DEV flag, the cached entitlements and, when the platform returned one at enrolment, the licence ID.
  • Check-ins: the 4-hour cron checks in with the platform even when automatic updates are off, and so do the Extensions and Version tabs (at most every 10 minutes). A revoked token is dropped and the plugin enrols the server again.
  • No connection: if the enrolment fails or the platform refuses the download, the installer stops before extracting anything. On an installed server that cannot reach the platform, Options → Version shows Offline, Options → Extensions shows Offline under Available in the Store (with the reason and Retry), and nothing is updated; installed free extensions keep running. Per Astral Internet's activation runbook, the platform refuses an enrolment whose source IP differs from the IP the server reports, which can happen behind NAT or on a server with several IPv4 addresses.

Toolbox DEV access is a per-server flag on the Activation platform, set from WHMCS with the Activer accès DEV button of the server's Toolbox service. Toolbox is free, so a server only has that button once it has an "Astral Toolbox" service in WHMCS. Until the platform sends Toolbox its own flag, Toolbox uses the server's shared licence flag, which the DEV button of another Astral product on the same server also sets. DEV access unlocks the dev channel (Options → Version → Update channel, or --channel=dev at install; the admin opts in, nothing switches by itself) and the DEV-only extensions ('channel' => 'beta': today Search And Replace; Mail Disk Space and Mail Scanner were until 2.1.3 and 0.3.2), which the Store and the installer then offer and the plugin loads, whatever channel the core follows. Without DEV access the server follows stable only, and DEV-only extensions are not offered. One already installed goes on running while its licence is valid (free, or an active subscription or trial), and automatic updates move it to the encoded build; once removed, it does not come back without DEV access. Without a valid licence it shows Not available in Options → Extensions and loads nothing; its files and settings stay, and it comes back once it has a licence, which Astral Internet sets up since the Store does not list it without DEV access. With DEV access alone it shows Licence needed and still loads nothing, even if Toolbox had turned it off and turns it back on. If a --channel=dev install stops at the Downloading the core (channel dev) block (« Activation or verification failed: nothing was installed… ») because DEV access is not set yet, the server is enrolled all the same: set DEV access, then run the same command again.

Paid extensions are set on the Activation platform (billing, trial length). A paid extension needs an active subscription or trial: the Store offers Start N-day trial, or Buy when the extension has a purchase link, and without either the extension shows Licence needed and does not load.

cPanel DNSOnly servers

Astral Toolbox is DNSOnly-native as of core 2.0.12:

  • DNSOnly ships no EasyApache / user-facing PHP — the php wrapper on the PATH fails with "Default PHP is not configured!". The installer (and every cron the plugin writes) therefore uses cPanel's internal interpreter /usr/local/cpanel/3rdparty/bin/php, which exists on every cPanel and DNSOnly box.
  • The plugin entry point carries a #!/usr/local/cpanel/3rdparty/bin/php shebang and is installed executable, so cpsrvd can run it without a system PHP handler.
  • On a DNSOnly node most extensions have little to do (no /home accounts, no mail, no MySQL websites). Server Monitoring is the extension that makes sense there.

Tip: if you mirror install.sh to your own server, upload it in binary mode. An ASCII-mode upload converts line endings to CRLF and breaks bash (\r: command not found).

Scheduled jobs

The extensions' recurring tasks (a scan, a collection, a clean-up) are run by the core, not by cron files of their own. /etc/cron.d/toolbox-scheduler starts cron/scheduler.php every minute; it starts each job due that minute in a process of its own, only while its extension is on, and never twice at once.

  • Each start, end, duration and status goes to /var/log/toolbox-scheduler.log, with what the job prints. The log is rotated at 5 MB (one old copy, .1).
  • A server updated from a core without the scheduler gets its cron line from the next auto-update pass.
  • As root, /usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/toolbox/cron/scheduler.php --list shows every job, whether it may run and its last run; --run=<slug>:<name> runs one now, in the terminal.
  • The auto-update keeps its own cron line, so updates go on even if the scheduler breaks.

Updates

Automatic (default)

  • /etc/cron.d/toolbox-auto-update runs cron/auto-update.php every 4 hours (randomized schedule per server).
  • Each run checks in with the Activation platform, then updates the core and every installed Store extension, each archive verified against the signed manifest like the installer does.
  • Controlled by the Disable automatic updates / Enable automatic updates button in Options → Version. When automatic updates are off, the cron stays in place and each run still checks in and refreshes the latest version shown on the Version tab, but installs nothing.

Manual

From Options → Version:

  • Check for updates: checks in, clears the version cache and asks for the latest version of the channel.
  • Install update: downloads and applies the new core immediately (var/state.json and the extensions' *.user.json overrides are preserved). Each new version, core or extension, is first tried beside the plugin: if it does not fit on the disk or does not load on this server's PHP, nothing changes and the current version stays.
  • Switch to the … build: shown with Channel switch pending after a channel change (see below).
  • Reinstall current version: replaces every core file on disk; useful if a previous update was corrupted.

Store extensions are updated from Options → Extensions (an Update badge and button appear next to an installed extension with a newer version).

Update channel

Options → Version → Update channel offers stable (the ionCube-encoded production build, every server) and, on a server with DEV access, dev (the plaintext development build). After Set channel, the Version tab shows Channel switch pending and a Switch to the … build button: click it to switch now. With automatic updates on, the next automatic update makes the switch if you don't. A switch replaces the core even at the same or a lower version; settings and data are kept. With automatic updates on, installed Store extensions follow at the next automatic update; a copy installed by core 2.0.18 or older, or any copy while automatic updates are off, moves to the new build at its next version.

Switching to stable is refused while cPanel's PHP cannot load ionCube (the Version tab shows ionCube Loader missing). A server that loses DEV access while on dev follows stable again at its next update. install.sh --channel=… on an installed server sets the channel as well.

Adding and removing extensions

See Core configuration → Extensions tab for the full walkthrough. In short:

  • Add: Options → Extensions → Available in the Store → Install next to the extension. It downloads, verifies, extracts and enables in one step. An extension with a console (Mail Scanner) shows its install steps first, and is turned on once they end well (see The install and removal console). A paid extension without a subscription shows Start N-day trial (or Buy, when it has a purchase link) instead.
  • Remove: Options → Extensions → Remove (shown once the extension is disabled, or when it is locked). The extension directory is removed with everything in it, your settings included, and so is what the extension placed outside it (scheduled task, log file, and so on).
  • Mail Scanner: Remove takes everything away, in one click. Mail goes back to cPanel's own spam filtering, the mail server restarts for a few seconds, then the scanner service, the message index, the messages held in each account's quarantine, the logs and the extension's settings are erased for good. Its SpamAssassin settings stay (zz_toolbox-mail.cf and the other files it wrote there), because the whole server reads them, and so do the shared learning database and the engines it installed (DCC, Pyzor). What is not its own stays too: a settings file it set aside when switching the learning database, and what it moved when removing a previous filter, both under /var/lib/toolbox-mail. Nothing is erased until the mail server is back on cPanel's filtering, checked: otherwise the extension stays, turned off, the page and its row say what to do, and pressing Remove again takes up where it stopped. If that will not change, Remove anyway, next to it on that row, takes the extension off all the same (see Remove anyway below). What a new press could not change is said on the page and does not hold the removal back: a disk mounted inside its folders. One line in the server's mail log (toolbox-mailscan) records a removal that finished, and names what stays. A server that still runs an older Mail Scanner uses that version's own removal, which erases nothing: update it first, where the Store offers it. On a core older than 2.0.23 the extension's own removal runs, but the confirmation does not announce the erasure and a removal that cannot finish is not shown: do it on 2.0.23 or later.
  • Disable without removing: Options → Extensions → Disable (keeps files and settings on disk).
    • Mail Scanner: mail goes back to cPanel by itself. Within a minute or two of Mail Scanner being disabled, its own task of the minute puts the mail server back on cPanel's own spam filtering, checks it, and writes it in its record of actions; its spam mark stops in the same minute, and its customers' page right away. Enabling it again does not connect the mail server back: the « Mail Scanner » line of Configuration › Server state then says off, with Turn on. Its spam mark comes back on by itself, and is added again once the mail server is connected. That mark is always on while Mail Scanner is enabled: an X-Toolbox-Spam header on every message it scores, Yes from the Junk folder from score (Configuration › Settings › Spam filtering) up and No below it, none on a message it could not score, and none while it cannot confirm that it sees every message (it holds the header back by itself, and adds it again once it can). Its scanner service and that task stay on the server meanwhile: recording, the history clean-up and the quarantine purge go on, and its SpamAssassin settings stay in cPanel's.

The install and removal console

An extension can ask to be installed and removed in a console (its manifest says installConsole; Mail Scanner does). Its Install, Update, Repair, Start trial and Remove then open a panel right under the extension's row of Options → Extensions that shows its steps as they run on the server, like a terminal. A step can be a status line that changes in place: « Scanner service: Installing… », then « Installed ».

  • The steps run in the background, out of the page: closing the page or the browser does not stop them. The extension's row offers Open the console while they run, while they wait for an answer, and after they stopped or failed.
  • While the steps run or wait for an answer, the row offers nothing else, except Disable for an extension that is on: Enable, Update, Start trial and Remove come back once they end. After steps that stopped or failed, those buttons are there again.
  • A step whose right choice depends on the server asks it: the steps stop, the question shows under the log with one button per choice, and the answer starts them again from the top. The steps already done are passed over.
  • A fresh install is turned on once its steps end well; an update or a repair keeps the extension on or off as it was.
  • A run that stopped before its end (the server restarted, for one) offers Resume; an install that failed offers Try again.
  • A removal never stops to ask: what its confirmation offers is chosen before it starts. Remove anyway works as before, without a console.
  • From the command line (install/extensions.php install or uninstall-all), a question takes its default, or the answer given with --answer <id>=<value> (the installer prints each question with the option that answers it).

Mail Scanner sets the server up on a fresh install, in the console, with one status line per component:

  • the checks of the server, the ones its Configuration tab shows under Server state;
  • the recommended settings, in one pass (one rebuild of the mail server, one restart of SpamAssassin), then one line per setting with its result. Among them: the learning thresholds (a message is learned as spam from a score of 8, as not spam below -2), and, where the KAM rule set is installed, a lower score for two of its block-list rules (3.5 and 4.5), which sent legitimate mail to the Spam folder on their own;
  • spam learning shared by every account of the server, when it is not yet;
  • message tracking: the scanner service and the mail server connection;
  • what the checks still say, and that filtering is on. Its spam mark starts within a few minutes, once it has checked that it sees every message.

It asks one thing only, and only when it is due: a change to the server's DNS settings (NetworkManager kept from rewriting the resolvers WHM sets, and the DNS servers of the network interfaces aligned with them, so that a restart of the server does not bring other ones back), made on a yes. On the command line (install/extensions.php install mail-scanner) that change is left out unless --answer dns=yes is given; install.sh and setup.sh do not take that option.

Its removal also shows one line per step: the spam mark, the mail server connection, recording (paused while the removal runs), the customer page in cPanel, the customers' quarantines, then the scanner service and the recorded data.

Lifecycle hooks

Every install, update (manual or by the auto-update cron) and uninstall lets the extension act on what it keeps outside its own directory. That includes the command-line installer, which runs the install steps of the bundled extensions and of those it installs, and the command-line uninstaller, which runs each extension's removal steps one by one. Run from the command line, a hook can show its own steps in its extension's block (Extension::installOutput()):

  • onInstall(previousVersion) fires right after the archive is extracted, with null on a fresh install and the version being replaced on an update. Mail Scanner uses it to set the server up on a fresh install (see the console, above), and to re-run its daemon installer after an update, so the daemon that runs is the one that just landed (not while Mail Scanner is disabled: its task of the minute does it once it is enabled again). An update itself reconnects the mail server when it comes from a version before 0.3.0, or when a previous version's connection is still in place, if the extension is enabled and connected. When it cannot, the Mail Scanner line of Configuration › Server state says needs repair, and Repair puts it in place.
  • onUninstall() fires right before the directory is removed (cron drop-ins, cPanel hooks, and so on).

A hook asks the admin through installOutput()->ask($id, $question, $choices, $default). In a console, an install stops there until the question is answered, then runs the hook again from the top with that answer known, so the hook must check before each step and ask before the step a question decides, never in the middle of one. A removal gets the options its confirmation offered (manifest removeOptions: an id, a label, a default) as answers. Elsewhere (the auto-update cron, an extension without a console) ask() returns the default.

Both are best-effort: a failing hook is logged and never blocks the install or the removal. The one exception is an extension that reports, through uninstallProblems(), what kept its removal from finishing: its directory then stays, with its Remove button and, next to it, Remove anyway. After an uninstall (install/uninstall.sh) that stopped further on, an extension whose onUninstall() already ran may be turned back on: Enable does not run a hook, so what onUninstall() took (its schedule, what it recorded) has to be set again on its own page.

Uninstalling Astral Toolbox

Over SSH only, as root, in one line. WHM has no Uninstall button.

bash /usr/local/cpanel/whostmgr/docroot/cgi/toolbox/install/uninstall.sh

It prints one framed block per step on the terminal and writes the same lines to /var/log/toolbox-uninstall.log. It asks for a confirmation (-y skips it; without a terminal it refuses rather than guess). An extension's removal choices take their default, or the answer given with --answer=<id>=<value>. It copies itself to a temporary folder first, since it deletes the folder it comes from.

  1. Each extension, one by one, in its own block, turned off or not, with its data: its scheduled task, its log file, what it placed outside the plugin (Mail Disk Space: its cPanel resource-usage hook, and the usage file it left in each account). Mail Scanner goes first and does what its Remove does: mail back on cPanel's own spam filtering, then its data erased; its SpamAssassin settings stay.
  2. Scheduled tasks: the /etc/cron.d/toolbox-* files that run the plugin. A toolbox-* file of another tool, one that does not name the plugin's folder, stays, and the block names it.
  3. WHM registration: the AppConfig and the addon icon.
  4. Runtime files: the plugin's logs in /var/log (the core's, its extensions', and those its cron files write, rotations included), the update probe folders, and /var/cpanel/toolbox (the licence token and the locks).
  5. Plugin files: the whole plugin tree.

It leaves in place the ioncube entry the installer added to WHM's PHP loader setting, the server's licence on the Activation platform, and /var/log/toolbox-uninstall.log. The licence token (/var/cpanel/toolbox/activation.json) goes: a reinstall enrols the server again.

  • An extension that could not finish stops the uninstall. When an extension reports what kept it from finishing (Mail Scanner: mail could not be given back to cPanel), nothing else is removed: its block says why, the extension stays in the list, turned off, and running the command again takes up where it stopped.
  • --anyway. For when what holds an extension back will not change: the plugin is removed all the same. It is ignored while a refusal says to wait for something to finish (Mail Scanner: cPanel rebuilding the mail server's settings, or a task still using what it recorded): wait, then run the command again. What that extension could not remove stays on the server: for Mail Scanner, the mail server may stay connected to its scanner service, which nothing manages any more. Its cPanel hook (on a server connected with this version or later, where cPanel's hook spot was free) notices that the extension is gone: at cPanel's next rewrite of the mail server settings, it takes Mail Scanner out of the files cPanel builds them from, and the rewrite after that gives mail back to cPanel's own spam filtering. Once mail is back on cPanel's own spam filtering, a later fresh install of Mail Scanner leaves it there until you connect it: Turn on, on the Mail Scanner line of Configuration › Server state.
  • Remove anyway. The same way out for one extension, in WHM, shown on its row (Extensions tab) when its Remove keeps refusing and the Store offers no Repair, or Repair does not help. The extension goes even if its removal steps cannot finish, and its hook is not run again if it is known to have taken the page down. The last page says that what it could not remove stays on the server. The plugin and the other extensions stay. It is not offered for the first hour of a refusal that says to wait for something to finish: wait, then press Remove again. A folder whose manifest no longer loads has this button on its own row of the Extensions tab (Files damaged), under its folder's name: no hook can run, and the same row offers Repair when the catalogue lists it.
Flag Effect
-y, --non-interactive Do not ask for a confirmation.
--anyway Go on when an extension cannot finish its removal: what it could not remove then stays on the server. Ignored while a refusal says to wait. Without it, an extension folder with damaged files also stops the uninstall.
--answer=<id>=<value> The answer to one of an extension's removal choices (repeatable).
--verbose Also show the output of every command on screen.
--help, -h Print usage.

The confirmation ([y/N]) defaults to no. If the plugin folder no longer exists, the command only removes what it left elsewhere. Each uninstall leaves a toolbox-uninstall line in the system log.

Exit status: 0 uninstalled, or nothing removed (confirmation declined, or neither a terminal nor -y); 2 another install or removal is running, or an unknown option; 3 an extension refused its removal (the plugin stays); 1 any other error.