aboutsummaryrefslogtreecommitdiffstats
path: root/juju/command.sh
blob: 84643de81d1c83a85dc83883e36b1e6b0d2b5b17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
##############################################################################
# Copyright (c) 2016-2017 HUAWEI TECHNOLOGIES CO.,LTD and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

function exec_cmd_on_client()
{
    local ssh_args="-o StrictHostKeyChecking=no"

    if [ ! $juju_client_ip ]; then
        log_error "juju-client ip not found"
        exit 1
    fi
    ssh $ssh_args ubuntu@$juju_client_ip "$@"
}

function scp_to_client()
{
    local ssh_args="-o StrictHostKeyChecking=no"

    if [ ! $juju_client_ip ]; then
        log_error "juju-client ip not found"
        exit 1
    fi
    scp $ssh_args $1 ubuntu@$juju_client_ip:$2
}