1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/usr/local/bin/andy func upload file { if test $file = '-' { set file /dev/stdin } curl ( --retry-all-errors -X POST -H "Authorization: $TOKEN" -F "data=@$file" https://paste.thomasvoss.com ) } set TOKEN `vlt raw Miscellaneous 'Mpaste (Key)' test $#args -ge 2 || set args $args - for $args[1..] { async upload $_ } wait