Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3475 - (show 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 # $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 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 }