Skip to content

Instantly share code, notes, and snippets.

@kotnik
Created May 22, 2014 08:56
Show Gist options
  • Save kotnik/77216de48277ac213bfa to your computer and use it in GitHub Desktop.
Save kotnik/77216de48277ac213bfa to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -z "$1" ]]; then
echo "Need filename"
exit 1
fi
file_ext=$(echo $1 |awk -F . '{if (NF>1) {print $NF}}')
file=$(mktemp /tmp/XXXXXX.$file_ext)
cp "$1" $file
chmod 644 $file
scp -q -o "LogLevel quiet" "$file" SITE:DOMAN_ROOT/
echo -n "http://$SITE/"
echo $(basename $file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment