Fixes to kvmsu function
[lxc-userspace.git] / scp_forward_agent.py
1 #!/usr/bin/python
2
3 # Run this script as:
4 # scp -S scp_forward_agent.py user@node
5
6 import sys
7 import os
8
9 new_args = []
10 fixed = False
11 for arg in sys.argv[1:]:
12         if ('-oForwardAgent=no'==arg):
13                 arg = '-oForwardAgent=yes'
14                 fixed = True
15         new_args.append(arg)
16
17 if (not fixed):
18         new_args = ['-oForwardAgent=yes'] + new_args
19
20 os.execv('/usr/bin/ssh',['/usr/bin/ssh']+new_args)