# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/serial_functions.sh,v 1.2 2005-04-12 20:45:55 niro Exp $ # 1.serial 2.mtime 3.mac validate_serial() { local serial local db_serial local mtime local mac # abort if params are missing [ $# -ne 3 ] && return 1 serial=$1 mtime=$2 mac=$3 db_serial=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ "select serial from client_serials where mtime='${mtime}' and mac='${mac}'" ) if [[ ${db_serial} = ${serial} ]] then return 0 else return 1 fi }