mirror of
https://github.com/srlabs/blue-merle.git
synced 2024-12-22 05:44:59 -05:00
functions: provide a Lua-based IMEI generation
Soon, we can retire the relatively expensive Python script and use shell and Lua.
This commit is contained in:
parent
4b427bbcfc
commit
9a3f072c23
@ -78,8 +78,14 @@ READ_IMSI () {
|
||||
}
|
||||
|
||||
|
||||
GENERATE_IMEI() {
|
||||
local seed=$(head -100 /dev/urandom | tr -dc "0123456789" | head -c10)
|
||||
local imei=$(lua /lib/blue-merle/luhn.lua $seed)
|
||||
echo -n $imei
|
||||
}
|
||||
|
||||
SET_IMEI() {
|
||||
imei="$1"
|
||||
local imei="$1"
|
||||
|
||||
if [[ ${#imei} -eq 14 ]]; then
|
||||
gl_modem AT AT+EGMR=1,7,${imei}
|
||||
|
Loading…
Reference in New Issue
Block a user