Created
January 20, 2021 04:30
-
-
Save SteVwonder/e541ce03c053a737e4bf2838c521853f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
import subprocess | |
def find_split_point(argv): | |
for idx, val in enumerate(argv): | |
if val == "relay": | |
return idx - 1 | |
def main(): | |
ld_lib_path = os.getenv("LD_LIBRARY_PATH") | |
new_argv = sys.argv.copy() | |
new_argv[0] = os.getenv("FLUX_SSH_SSH", "mrsh") | |
if ld_lib_path: | |
split_point = find_split_point(sys.argv) | |
new_argv.insert(split_point, "LD_LIBRARY_PATH={}".format(ld_lib_path)) | |
subprocess.Popen(new_argv).communicate() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment