Commit eb020943 by Fred Smith

error handling around scp uploads

parent e9b66c7e
......@@ -5,7 +5,11 @@
file_basename=$(basename $1)
notify-send "uploading $file_basename"
scp $1 io:/var/www/files.derf.us/
echo "https://files.derf.us/$file_basename" | xclip -selection clipboard
notify-send "upload of $file_basename complete"
sleep .5
scpoutput=$(scp $1 io:/var/www/files.derf.us/)
if [[ $? == 1 ]]; then
notify-send "upload failed $scpoutput"
else
echo "https://files.derf.us/$file_basename" | xclip -selection clipboard
notify-send "upload of $file_basename complete"
sleep .5
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment