argument('configuration'); $source = base_path().self::SOURCE_FAIL2BAN_JAIL_DIRECTORY.'/'.$configuration.'.conf'; // configuration not found if (!file_exists($source)) { $this->error('fail2ban...configuration not found'); exit(); } $destination = self::DESTINATION_FAIL2BAN_JAIL_DIRECTORY.'/'.$configuration.'.conf'; // configuration already enabled if (file_exists($destination)) { $this->info('fail2ban...configuration already enabled'); exit(); } copy($source, $destination); $this->info('fail2ban...'.$configuration.' enabled'); exec('service fail2ban restart'); } }