Docs

Scripts and event hooks

Run your own programs when accounts change, and use the panel's command-line tools.

Event scripts (hooks)#

A hook is a program of your own that the panel runs when something happens to an account, for example to tell a billing system or to write a log. The events are:

EventWhen it runs
account-createdAfter a hosting account is created
account-deletedAfter a hosting account is deleted
account-suspendedAfter a hosting account is suspended
account-unsuspendedAfter a suspended account is restored

Add a hook#

  1. Put a program named exactly after the event into /etc/intopanel/hooks, for example /etc/intopanel/hooks/account-created.
  2. Make it owned by root and readable and runnable by root only:
chown root:root /etc/intopanel/hooks/account-created
chmod 700 /etc/intopanel/hooks/account-created
  1. Open Developer Tools → Event Scripts (Hooks) in the admin area. The event shows Installed. If the file is there but not safe to run, it shows Not run with the reason.

The program gets the account's username as its first argument and, when an account is created, the main domain as the second. The same values are in the environment as INTOPANEL_USER, INTOPANEL_DOMAIN and INTOPANEL_EVENT.

#!/bin/bash
# /etc/intopanel/hooks/account-created
echo "$(date -u +%FT%TZ) $INTOPANEL_EVENT $INTOPANEL_USER $INTOPANEL_DOMAIN" >> /root/account-events.log

Command-line tools#

Reset a lost administrator password, create another administrator, or switch off two-step sign-in for a login that lost its phone:

runuser -u intopanel -- /usr/local/intopanel/bin/intopanel-web -reset-password admin
runuser -u intopanel -- /usr/local/intopanel/bin/intopanel-web -create-admin NAME
runuser -u intopanel -- /usr/local/intopanel/bin/intopanel-web -disable-two-step NAME

Check the two parts of the panel:

systemctl status intopanel-web intopaneld
journalctl -u intopaneld -n 100 --no-pager

intopanel-web serves the pages; intopaneld runs as root and makes the changes. If the dashboard says "The panel daemon did not answer", start with systemctl status intopaneld.