#!/bin/bash

[[ $1 == '' ]] && echo 'Put some file into https://recolic.net/tmp/. Usage: netpush <filename>' && exit 1

function do_push () {
    _path="$1"
    _name=$(basename "$1" | tr -d ' `~!@#$%^&*()?')
    scp "$_path" "root@func.main.recolic.cc:/srv/html/tmp/$_name" &&
    echo "Pushed to https://recolic.cc/tmp/$_name"
}

for fl in "$@"
do
    do_push "$fl"
done

