scripts

Various scripts for UNIX-like systems
git clone https://git.tronto.net/scripts
Download | Log | Files | Refs | README

share (319B)


      1 #!/bin/sh
      2 
      3 # One-liner to upload stuff to my webserver
      4 
      5 srv=tronto.net
      6 dir=$(tr -cd 'a-z0-9' < /dev/random | fold -w 8 | head -n 1)
      7 htp=https://share.tronto.net/$dir
      8 pth=/var/www/htdocs/share.tronto.net/$dir
      9 url=$srv:$pth
     10 
     11 ssh tronto.net mkdir "$pth"
     12 scp "$@" "$url"/
     13 for i in "$@"; do echo "$htp/$(basename $i)"; done