summaryrefslogtreecommitdiff
path: root/script/moveto3.py
diff options
context:
space:
mode:
Diffstat (limited to 'script/moveto3.py')
-rwxr-xr-xscript/moveto3.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/script/moveto3.py b/script/moveto3.py
deleted file mode 100755
index 408ff1a..0000000
--- a/script/moveto3.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python3
-import argparse
-import os
-
-
-def main():
- ap = argparse.ArgumentParser()
- ap.add_argument("-a", default="qmail-authuser", dest="pam")
- ap.add_argument("fd", type=int)
- ap.add_argument("prog")
- ap.add_argument("args", nargs="*")
-
- vals = ap.parse_args()
-
- if vals.fd < 3:
- raise ValueError(f"fd({vals.fd}) must be 3 or greater")
-
- if vals.fd != 3:
- os.dup2(vals.fd, 3)
- os.close(vals.fd)
-
- os.execvp(vals.pam, [vals.pam, vals.prog] + vals.args)
-
- raise ValueError("should not be reachable")
-
-
-if __name__ == "__main__":
- main()