link-tarball 574 Bytes
Newer Older
1 2
#!/bin/sh

3 4 5
if [ -n $1 ]; then
  clnet_home="$1"
else
6
  echo "Remote directory must be specified."
7
  exit 2
8
fi
9 10 11 12 13 14 15 16
if [ -n "$2" ]; then
  user="${2}@"
else
  echo "Remote username not specified"
  echo "Assuming remote user is same as local"
  echo "and/or you configured your .ssh/config with:"
  echo "Host common-lisp.net"
  echo "   User = foo"
17 18 19 20 21 22 23
fi

tarball=`ls tmp/asdf*.tar.gz`
tarball=`basename $tarball`
latest="asdf.tar.gz"

echo "Link $tarball to $latest"
24
ssh ${user}common-lisp.net "rm -f $clnet_home$latest; \
25
  ln -s $clnet_home/archives/$tarball $clnet_home$latest"