snipplets.dev/code/Crystal/value_from_match.cr
2023-09-26 22:05:13 +03:00

9 lines
210 B
Crystal

test_string_1 = "rw------- (0o600)"
# test_string_2 = "rwx------ (0o700)"
if /\d{3}/.match(test_string_1).try &.[0] != "600"
puts "Password file permissions is not RW for you.".colorize(:red)
exit(0)
end