Annotation of /alx-src/branches/alxconf-060/functions/serial_functions.sh
Parent Directory | Revision Log
Revision 3469 -
(hide annotations)
(download)
(as text)
Fri Apr 13 17:35:15 2012 UTC (12 years, 1 month ago) by niro
File MIME type: application/x-sh
File size: 619 byte(s)
Fri Apr 13 17:35:15 2012 UTC (12 years, 1 month ago) by niro
File MIME type: application/x-sh
File size: 619 byte(s)
-fixed header
1 | niro | 3469 | # $Id$ |
2 | |||
3 | niro | 228 | # 1.serial 2.mtime 3.mac |
4 | validate_serial() | ||
5 | { | ||
6 | local serial | ||
7 | local db_serial | ||
8 | local mtime | ||
9 | local mac | ||
10 | |||
11 | # abort if params are missing | ||
12 | [ $# -ne 3 ] && return 1 | ||
13 | |||
14 | serial=$1 | ||
15 | mtime=$2 | ||
16 | mac=$3 | ||
17 | |||
18 | niro | 345 | db_serial=$(mysqldo "select serial from client_serials where mtime='${mtime}'" ) # and mac='${mac}'" ) |
19 | niro | 228 | |
20 | if [[ ${db_serial} = ${serial} ]] | ||
21 | then | ||
22 | return 0 | ||
23 | else | ||
24 | return 1 | ||
25 | fi | ||
26 | } | ||
27 | niro | 305 | |
28 | show_invalid_serial_msg() | ||
29 | { | ||
30 | echo -e ${COLRED} | ||
31 | echo "Current Serial '${ALX_SERIAL}' is invalid." | ||
32 | echo "None of the current settings of this client will be touched." | ||
33 | echo "Please inform your system-administrator." | ||
34 | echo -e ${COLDEFAULT} | ||
35 | } |