/* ARISA - Admin Interface - Main Menu * Copyright (C) 2003 Carl Ritson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /** Main Menu Commands **/ MENU_CMD(cmd_shutdown) { if(strcasecmp(args[1],"now") == 0) { arisa_signal_end(); } else if(strcasecmp(args[1],"cancel") == 0) { LOCK(global); global->end = 0; global->end_time = 0; UNLOCK(global); } else if(strcasecmp(args[1],"delayed") == 0) { LOCK(global); global->end_time = TIME_MAX; global->end = 1; UNLOCK(global); } else if(strcasecmp(args[1],"timed") == 0) { if(no_args >= 3) { LOCK(global); global->end_time = xtime() + strtoul(args[2],NULL,10); global->end = 1; UNLOCK(global); } else admin_msg(ac,"%s timed ",args[0]); } else admin_msg(ac,"%s [now|cancel|delayed|timed] []",args[0]); return 0; } /** Main Menu Structure **/ static const cmd_t main_menu[] = { {"shutdown", cmd_shutdown, 1,2,1,0, PRIV_TO_MASK(PRIV_SHUTDOWN), NULL}, {NULL} };