Contents of /alx-src/tags/alxconf-0_6_0-rc2/functions/serial_functions.sh
Parent Directory | Revision Log
Revision 239 -
(show annotations)
(download)
(as text)
Tue Apr 12 20:46:52 2005 UTC (19 years, 5 months ago) by niro
Original Path: alx-src/trunk/alxconfig-ng/functions/serial_functions.sh
File MIME type: application/x-sh
File size: 538 byte(s)
Tue Apr 12 20:46:52 2005 UTC (19 years, 5 months ago) by niro
Original Path: alx-src/trunk/alxconfig-ng/functions/serial_functions.sh
File MIME type: application/x-sh
File size: 538 byte(s)
import from aka-cvs
1 | # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/serial_functions.sh,v 1.2 2005-04-12 20:45:55 niro Exp $ |
2 | # 1.serial 2.mtime 3.mac |
3 | validate_serial() |
4 | { |
5 | local serial |
6 | local db_serial |
7 | local mtime |
8 | local mac |
9 | |
10 | # abort if params are missing |
11 | [ $# -ne 3 ] && return 1 |
12 | |
13 | serial=$1 |
14 | mtime=$2 |
15 | mac=$3 |
16 | |
17 | db_serial=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
18 | "select serial from client_serials where mtime='${mtime}' and mac='${mac}'" ) |
19 | |
20 | if [[ ${db_serial} = ${serial} ]] |
21 | then |
22 | return 0 |
23 | else |
24 | return 1 |
25 | fi |
26 | } |