You are currently browsing the archives for the tag bash script upload code.

Lazy sharing script, round 2

2008
19
Nov

I've just updated my script to support multiple uploads.

#!/bin/sh
HOST="foo.com"
DIRECTORY="/var/www/files/"
BASE_URL="http://foo.com/files/"

for i in $@; do
  scp -r "$i" $HOST:$DIRECTORY
  URL=$URL$BASE_URL$(basename $i | sed 's/ /%20/g')"\n"
done;
echo -n $URL | xclip -selection clipboard
echo $URL;