#! /bin/sh # Copyright (C) 2005 Nick Urbanik # 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. function usage { local prog=$(basename $0) cat <<"EOF" $prog groupname limit where: groupname is a game group such as silly or educational limit is a new limit of time that can be played for that group, such as 1800 For example, you could have the group educational have a limit of 1800 seconds playing time with: $prog educational 1800 EOF } if [ "$#" -ne "2" ] then usage exit 1 fi if $(echo $2|egrep -q '^[0-9]+$') then echo -- psql games --command "update limits set limit_seconds = $2 where groupname = '$1';" if psql games --command "update limits set limit_seconds = $2 where groupname = '$1';" | grep 'UPDATE 1' then psql games --command "select * from limits;" fi else echo Need to call this script with a single number of seconds to set both limits to. exit 1 fi