From 90da51ed5a0a19ab339194fa605ce6cb9dfd4fa9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 8 Feb 2022 14:59:33 +0100 Subject: [PATCH] q7s-cp can now copy to flatsat as well --- scripts/q7s-cp.py | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/scripts/q7s-cp.py b/scripts/q7s-cp.py index 0478001a..e3b1f37c 100755 --- a/scripts/q7s-cp.py +++ b/scripts/q7s-cp.py @@ -49,6 +49,13 @@ def handle_args(): action="store_true", help="Copy from Q7S to host instead. Always copies to current directory.", ) + parser.add_argument( + "-f", + "--flatsat", + default=False, + action="store_true", + help="Copy to flatsat instead" + ) # Positional argument(s) parser.add_argument( "source", help="Source files to copy or target files to copy back to host" @@ -61,18 +68,21 @@ def build_cmd(args): cmd = "scp " if args.recursive: cmd += "-r " - target = args.target - if args.invert and target == "": - target = "." - elif target == "": - target = f"/tmp" - if args.invert: - cmd += f"-P {args.port} root@localhost:{args.source} {target}" + if args.flatsat: + cmd += f"{args.source} eive@flatsat.eive.absatvirt.lw:{target}" else: - cmd += f"-P {args.port} {args.source} root@localhost:{target}" - if args.target: - cmd += args.target - return cmd + target = args.target + if args.invert and target == "": + target = "." + elif target == "": + target = f"/tmp" + if args.invert: + cmd += f"-P {args.port} root@localhost:{args.source} {target}" + else: + cmd += f"-P {args.port} {args.source} root@localhost:{target}" + if args.target: + cmd += args.target + return cmd if __name__ == "__main__":