changeset 372:1919706e94f5

stub copy-remote
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 23 Jul 2013 20:08:27 -0700
parents 0f679925616d
children 8d4a0a2a5038
files bin/copy-remote.sh
diffstat 1 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/copy-remote.sh	Tue Jul 23 20:08:27 2013 -0700
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# TODO -> silvermirror
+# (STUB)
+
+REMOTE=k0s.org
+
+if ! echo $PWD | grep '^'$HOME
+then
+  echo "should be in subtree of $HOME to use"
+  exit 1
+fi
+
+for i in "$@"
+do
+  if [ ! -e $i ]
+  then
+      echo "Error: $i does not exist"
+      exit 1
+  fi
+done
+
+for i in "$@"
+do
+ path=$(readlink -f $i)
+ if [ "${path:0:1}" != "/" ]
+ then
+ # relative path
+ #path=${PWD}/${path}
+ fi
+ scp ${REMOTE}:${path} ${path}
+done
\ No newline at end of file