summaryrefslogtreecommitdiff
path: root/src/helpers/simple-download.py
blob: 501af75f5f53178fbbd5fe28d376ee1f38cfed78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python3

import sys
from argparse import ArgumentParser
from vyos.remote import download

parser = ArgumentParser()
parser.add_argument('--local-file', help='local file', required=True)
parser.add_argument('--remote-path', help='remote path', required=True)

args = parser.parse_args()

try:
    download(args.local_file, args.remote_path,
             check_space=True, raise_error=True)
except Exception as e:
    print(e)
    sys.exit(1)

sys.exit()