aboutsummaryrefslogtreecommitdiffstats
path: root/juju/command.sh
diff options
context:
space:
mode:
Diffstat (limited to 'juju/command.sh')
-rwxr-xr-xjuju/command.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/juju/command.sh b/juju/command.sh
new file mode 100755
index 0000000..84643de
--- /dev/null
+++ b/juju/command.sh
@@ -0,0 +1,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
+}