Mercurial > hg > config
annotate bin/copy-remote.sh @ 767:35f8751c0930
it is very annoying to have ones overrides overridden; see also http://stackoverflow.com/questions/25381304/why-type-cd-on-mac-os-states-that-cd-is-a-function
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Thu, 28 Jan 2016 14:02:17 -0800 |
parents | 1919706e94f5 |
children |
rev | line source |
---|---|
372 | 1 #!/bin/bash |
2 | |
3 # TODO -> silvermirror | |
4 # (STUB) | |
5 | |
6 REMOTE=k0s.org | |
7 | |
8 if ! echo $PWD | grep '^'$HOME | |
9 then | |
10 echo "should be in subtree of $HOME to use" | |
11 exit 1 | |
12 fi | |
13 | |
14 for i in "$@" | |
15 do | |
16 if [ ! -e $i ] | |
17 then | |
18 echo "Error: $i does not exist" | |
19 exit 1 | |
20 fi | |
21 done | |
22 | |
23 for i in "$@" | |
24 do | |
25 path=$(readlink -f $i) | |
26 if [ "${path:0:1}" != "/" ] | |
27 then | |
28 # relative path | |
29 #path=${PWD}/${path} | |
30 fi | |
31 scp ${REMOTE}:${path} ${path} | |
32 done |