浏览文件
print_cidata_fstab.lua
16 行 · 369 B历史下载| 1 | #!/usr/libexec/flua |
| 2 | local yaml = require("lyaml") |
| 3 | local fpath = "/mnt/lima-cidata/user-data" |
| 4 | local f = io.open(fpath, "r") |
| 5 | if not f then |
| 6 | error("Could not open " .. fpath) |
| 7 | end |
| 8 | local content = f:read("*a") |
| 9 | f:close() |
| 10 | local config = yaml.load(content) |
| 11 | for i, row in ipairs(config.mounts) do |
| 12 | for j, value in ipairs(row) do |
| 13 | io.write(value, "\t") |
| 14 | end |
| 15 | io.write("\n") |
| 16 | end |

