Cron captive portal disconnect all user
-
Cron captive portal disconnect all user
-
Has been published here on the (this) forum.
Sorry, my search button is out for the day.edit : and repaired.
Here it is :#!/usr/local/bin/php -q <?php /* Disconnect all clients on all captive portal instances */ require_once("/etc/inc/util.inc"); require_once("/etc/inc/functions.inc"); require_once("/etc/inc/captiveportal.inc"); global $g, $config, $cpzone, $cpzoneid; /* Are there any portals ? */ if (is_array($config['captiveportal'])) { /* For every portal (cpzone), do */ foreach ($config['captiveportal'] as $cpkey => $cp) /* Sanity check */ if (is_array($config['captiveportal'][$cpkey])) /* Is zone enabled ? */ if (array_key_exists('enable', $config['captiveportal'][$cpkey])) { $cpzone = $cpkey; $cpzoneid = $cp['zoneid']; captiveportal_disconnect_all(); } } ?>
Place the file with extension php in, for example, /root/
Make a cron entry like
Pick time entries as you wish.
"pkg_check.php" must be the name of the file you created above.Start by installing the pfSense cron package.