1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 08:29:02 -08:00
rc/home/ea

39 lines
801 B
Text
Raw Normal View History

#!/usr/bin/env bash
# remote file access (http file-sharing shenanigans)
_REMOTE_DOMAIN="https://eaguru.guru"
_REMOTE_DIR="t"
_REMOTE_AUTH="auth"
eahead() {
2019-02-09 13:47:16 -08:00
curl -s -I "$_REMOTE_DOMAIN/$_REMOTE_DIR/$1"
}
2017-06-15 10:54:14 -07:00
eaget() {
curl "$_REMOTE_DOMAIN/$_REMOTE_DIR/$1" -o "${2:-$1}"
}
eaput() {
2018-07-08 23:22:35 -07:00
curl -g -n -T "$1" "$_REMOTE_DOMAIN/$_REMOTE_AUTH/"
}
eamove() {
local src="$_REMOTE_DOMAIN/$_REMOTE_AUTH/$1"
local dst="$_REMOTE_DOMAIN/$_REMOTE_DIR/$2"
curl -n -X MOVE -H "Destination: $dst" "$src"
}
eacopy() {
local src="$_REMOTE_DOMAIN/$_REMOTE_AUTH/$1"
local dst="$_REMOTE_DOMAIN/$_REMOTE_DIR/$2"
curl -n -X COPY -H "Destination: $dst" "$src"
}
eadelete() {
curl -n -X DELETE "$_REMOTE_DOMAIN/$_REMOTE_AUTH/$1"
}
alias eamv=eamove
alias eacp=eacopy
alias earm=eadelete