/go/unblock: unblock from the Command Line

/go/unblock reverses block. It has three modes, chosen by the single argument: If you are not root, the command re-runs itself with sudo. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Unblock one IP address
/go/unblock 203.0.113.45

Arguments

The argument is checked in this order, and the first match wins:

Argument Mode What it does
log Log mode Unblocks every IP that has a file in /var/log/go/block/.
A domain with a /home/<domain>/www folder Domain mode Deletes all block rules in that domain’s Cloudflare zone.
An IPv4 or IPv6 address IP mode Unblocks that IP locally and in Cloudflare.
Anything else None Prints Invalid IP "<value>" and exits.

Address ranges such as 203.0.113.0/24 are not accepted as an argument. To remove a range rule, unblock an address inside it (see Range rules).

Examples

# Unblock an IPv4 address
/go/unblock 203.0.113.45

# Unblock an IPv6 address
/go/unblock 2001:db8::1

# Remove every Cloudflare block rule from one domain
/go/unblock example.com

# Unblock every IP that has a block log file, then delete the files
/go/unblock log

# Review the log of past runs
tail -n 20 /var/log/go/unblock.log

Output

IP mode

Message Meaning
Unblocking IP <ip> The local firewall step is running.
[<n>/<total>] Unblocking IP <ip> [<domain>] | <result> One line per hosted domain for the Cloudflare step.
Cloudflare result Meaning
Success. The block rule was deleted from the zone.
Not Found. Cloudflare has no such rule.
Failed. The delete request was rejected, or no rule was found for the IP.
No Zone ID. The domain was not found in the configured Cloudflare account.

Domain mode

Message Meaning
Unblocking All IPs [<domain>]... The zone was found and its block rules are being deleted.
[<n>/<total>] Unblocked rule ID: <id> - Status: Success. One rule was deleted.
[<n>/<total>] Unblocked rule ID: <id> - Status: Failed. One rule could not be deleted.

If the domain has no zone in the configured Cloudflare account, nothing is printed.

Exit status

Situation Status
IP mode, run completed 0
Invalid IP "<value>" 1
Domain mode (even when successful) 1
Log mode (even when successful) 1

See the full reference at /go/unblock and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *