diff --git a/resources/install/scripts/resources/functions/is_uuid.lua b/resources/install/scripts/resources/functions/is_uuid.lua new file mode 100644 index 0000000000..dc4647c8a3 --- /dev/null +++ b/resources/install/scripts/resources/functions/is_uuid.lua @@ -0,0 +1,13 @@ +function is_uuid(s) + if (string.len(s) == 36) then + local x = "%x"; + local t = { x:rep(8), x:rep(4), x:rep(4), x:rep(4), x:rep(12) } + local pattern = table.concat(t, '%-'); + result = s:match(pattern); + end + if (result == nil) then + return false; + else + return true; + end +end