function add_task($task, $hosts) { /*{{{*/ // check task CronTask::parseRule($task); $matched_hosts = get_hosts($hosts); foreach ((array) $matched_hosts as $host) { color_echo("add task [{$task}] to {$host}\n", 'green'); if (!add_task_to_host($task, $host)) { color_echo("add task to {$host} failed\n", "red"); } } return true; }