view bin/copy-remote.sh @ 501:f9a4e1572b54

add http://pietrushnic.blogspot.com/2012/02/arbtt-as-productivity-improver-for.html#.Uh_LB5WZi1E
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 29 Aug 2013 15:36:08 -0700
parents 1919706e94f5
children
line wrap: on
line source

#!/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