1 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/serial_functions.sh,v 1.1 2005-03-09 00:04:37 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/serial_functions.sh,v 1.4 2005-10-09 21:32:55 niro Exp $ |
2 |
# 1.serial 2.mtime 3.mac |
# 1.serial 2.mtime 3.mac |
3 |
validate_serial() |
validate_serial() |
4 |
{ |
{ |
14 |
mtime=$2 |
mtime=$2 |
15 |
mac=$3 |
mac=$3 |
16 |
|
|
17 |
db_serial=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
db_serial=$(mysqldo "select serial from client_serials where mtime='${mtime}'" ) # and mac='${mac}'" ) |
|
"select serial from client_serials where mtime='${mtime}' and mac='${mac}'" ) |
|
18 |
|
|
19 |
if [[ ${db_serial} = ${serial} ]] |
if [[ ${db_serial} = ${serial} ]] |
20 |
then |
then |
23 |
return 1 |
return 1 |
24 |
fi |
fi |
25 |
} |
} |
26 |
|
|
27 |
|
show_invalid_serial_msg() |
28 |
|
{ |
29 |
|
echo -e ${COLRED} |
30 |
|
echo "Current Serial '${ALX_SERIAL}' is invalid." |
31 |
|
echo "None of the current settings of this client will be touched." |
32 |
|
echo "Please inform your system-administrator." |
33 |
|
echo -e ${COLDEFAULT} |
34 |
|
} |