2017-03-02 23:24:01 -08:00
|
|
|
#!/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-03-02 23:24:01 -08:00
|
|
|
}
|
|
|
|
|
2017-06-15 10:54:14 -07:00
|
|
|
eaget() {
|
|
|
|
curl "$_REMOTE_DOMAIN/$_REMOTE_DIR/$1" -o "${2:-$1}"
|
|
|
|
}
|
|
|
|
|
2017-03-02 23:24:01 -08:00
|
|
|
eaput() {
|
2018-07-08 23:22:35 -07:00
|
|
|
curl -g -n -T "$1" "$_REMOTE_DOMAIN/$_REMOTE_AUTH/"
|
2017-03-02 23:24:01 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|