Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3469 - (show annotations) (download) (as text)
Fri Apr 13 17:35:15 2012 UTC (12 years ago) by niro
File MIME type: application/x-sh
File size: 619 byte(s)
-fixed header
1 # $Id$
2
3 # 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 db_serial=$(mysqldo "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 }
27
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 }