mirror of
https://github.com/notwa/rc
synced 2024-11-05 13:19:03 -08:00
35 lines
725 B
Text
35 lines
725 B
Text
|
#!/usr/bin/env bash
|
||
|
# remote file access (http file-sharing shenanigans)
|
||
|
|
||
|
_REMOTE_DOMAIN="https://eaguru.guru"
|
||
|
_REMOTE_DIR="t"
|
||
|
_REMOTE_AUTH="auth"
|
||
|
|
||
|
eahead() {
|
||
|
curl -I "$_REMOTE_DOMAIN/$_REMOTE_DIR/$1"
|
||
|
}
|
||
|
|
||
|
eaput() {
|
||
|
curl -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
|