repo: actpub
action: blob
revision: 
path_from: ap-upload-to-outbox
revision_from: refs/heads/master:
path_to: 
revision_to: 
git.thebackupbox.net
actpub
git clone git://git.thebackupbox.net/actpub

blob of:

actpub

/ ap-upload-to-outbox

blob_plain of this file

refs/heads/master:/ap-upload-to-outbox

 #!/usr/bin/env bash
 #basename="$(basename "$1")"
 #shellsafe="$(printf "%s\n" "$basename" | sed 's/'\''/'\''\\'\'''\''/g')"
 #echo $1
 ### we need "$1" to have its full path to prevent : problems

 fullpath="$(uriunescape "$(normalpath "$1")")"
 basename="$(basename "${fullpath}")"
 webbased="$(uriescape "${basename}")"
 #echo "uploading: $fullpath to..."
 host=21.41.41.5
 target="/home/epoch/public_html/outbox2/"
 target_uri="scp://${host}/${target}"
 #echo "$target scp://${host}/${target}"

 scp "${fullpath}" "${target_uri}" 2>&1 >/dev/null

 #echo $?
 uri="https://thebackupbox.net/~epoch/outbox/${webbased}"
 printf "%s" "$uri" | xclip -i