2019-03-21 21:31:27 -04:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
2026-05-07 20:43:42 -05:00
|
|
|
import tempfile
|
2019-03-21 21:31:27 -04:00
|
|
|
import os
|
|
|
|
|
import sys
|
2026-05-07 20:43:42 -05:00
|
|
|
|
|
|
|
|
from posix_parity import mergerfs_mount
|
2019-03-21 21:31:27 -04:00
|
|
|
|
|
|
|
|
|
2026-04-29 17:44:22 -05:00
|
|
|
def main():
|
2026-05-07 20:43:42 -05:00
|
|
|
try:
|
|
|
|
|
with mergerfs_mount() as (mount, _):
|
|
|
|
|
(fd, filepath) = tempfile.mkstemp(dir=mount)
|
2019-03-21 21:31:27 -04:00
|
|
|
|
2026-05-07 20:43:42 -05:00
|
|
|
os.unlink(filepath)
|
2019-03-21 21:31:27 -04:00
|
|
|
|
2026-05-07 20:43:42 -05:00
|
|
|
found = False
|
|
|
|
|
for entry in os.scandir(mount):
|
|
|
|
|
if entry.name.startswith(".fuse_hidden"):
|
|
|
|
|
print("found .fuse_hidden file {}".format(entry.name), end='')
|
|
|
|
|
found = True
|
2019-03-21 21:31:27 -04:00
|
|
|
|
2026-05-07 20:43:42 -05:00
|
|
|
os.close(fd)
|
2026-04-29 17:44:22 -05:00
|
|
|
|
2026-05-07 20:43:42 -05:00
|
|
|
if found:
|
|
|
|
|
return 1
|
|
|
|
|
return 0
|
|
|
|
|
except RuntimeError as exc:
|
|
|
|
|
print(str(exc), end="")
|
|
|
|
|
return 77
|
2026-04-29 17:44:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2026-05-07 20:43:42 -05:00
|
|
|
raise SystemExit(main())
|