mirror of https://github.com/n1nj4sec/pupy.git
adding expandvars function
This commit is contained in:
parent
d013ee7b57
commit
65e7d7d0a0
|
@ -15,7 +15,8 @@ class UploaderScript(PupyModule):
|
||||||
self.arg_parser.add_argument('local_file', metavar='<local_path>', completer=path_completer)
|
self.arg_parser.add_argument('local_file', metavar='<local_path>', completer=path_completer)
|
||||||
self.arg_parser.add_argument('remote_file', metavar='<remote_path>')
|
self.arg_parser.add_argument('remote_file', metavar='<remote_path>')
|
||||||
def run(self, args):
|
def run(self, args):
|
||||||
if args.remote_file.endswith('.'):
|
dst = self.client.conn.modules['os.path'].expandvars(args.remote_file)
|
||||||
args.remote_file = args.remote_file.replace('.', args.local_file.split(os.sep)[-1])
|
if dst.endswith('.'):
|
||||||
upload(self.client.conn, args.local_file, args.remote_file)
|
dst = dst.replace('.', args.local_file.split(os.sep)[-1])
|
||||||
self.success("file local:%s uploaded to remote:%s"%(args.local_file, args.remote_file))
|
upload(self.client.conn, args.local_file, dst)
|
||||||
|
self.success("file local:%s uploaded to remote:%s"%(args.local_file, dst))
|
||||||
|
|
Loading…
Reference in New Issue