# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/serial_functions.sh,v 1.3 2005-08-28 19:30:03 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 } show_invalid_serial_msg() { echo -e ${COLRED} echo "Current Serial '${ALX_SERIAL}' is invalid." echo "None of the current settings of this client will be touched." echo "Please inform your system-administrator." echo -e ${COLDEFAULT} }