Contents of /alx-src/branches/alxconf-060/functions/serial_functions.sh
Parent Directory | Revision Log
Revision 543 -
(show annotations)
(download)
(as text)
Wed Feb 4 19:51:39 2009 UTC (15 years, 7 months ago) by niro
Original Path: alx-src/branches/alxconf_20060908/alxconfig-ng/functions/serial_functions.sh
File MIME type: application/x-sh
File size: 729 byte(s)
Wed Feb 4 19:51:39 2009 UTC (15 years, 7 months ago) by niro
Original Path: alx-src/branches/alxconf_20060908/alxconfig-ng/functions/serial_functions.sh
File MIME type: application/x-sh
File size: 729 byte(s)
- created alxconf_20060908 branch for the stable-050 alx based on tag alxconf_20060908_1
1 | # $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 |
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=$(mysqldo "select serial from client_serials where mtime='${mtime}'" ) # and mac='${mac}'" ) |
18 | |
19 | if [[ ${db_serial} = ${serial} ]] |
20 | then |
21 | return 0 |
22 | else |
23 | return 1 |
24 | 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 | } |