Magellan Linux

Annotation of /alx-src/branches/alxconf-060/functions/serial_functions.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3475 - (hide annotations) (download) (as text)
Fri Apr 13 18:10:51 2012 UTC (12 years, 1 month ago) by niro
File MIME type: application/x-sh
File size: 638 byte(s)
use rc_echo()
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 niro 3475 rc_echo -e "${COLRED}"
31     rc_echo "Current Serial '${ALX_SERIAL}' is invalid."
32     rc_echo "None of the current settings of this client will be touched."
33     rc_echo "Please inform your system-administrator."
34     rc_echo -e "${COLDEFAULT}"
35 niro 305 }