2021-08-29 12:00:18 +00:00
|
|
|
{ pkgs }:
|
|
|
|
pkgs.symlinkJoin {
|
|
|
|
name = "cyberlocker-tools";
|
|
|
|
paths = [
|
|
|
|
(pkgs.writers.writeDashBin "cput" ''
|
|
|
|
set -efu
|
2021-08-29 12:15:47 +00:00
|
|
|
path=''${1:-$(hostname)}
|
2021-08-31 20:44:27 +00:00
|
|
|
path=$(echo "/$path" | sed -E 's:/+:/:')
|
|
|
|
url=http://c.r$path
|
2021-08-29 12:00:18 +00:00
|
|
|
|
2021-08-31 20:44:27 +00:00
|
|
|
${pkgs.curl}/bin/curl -fSs --data-binary @- "$url"
|
|
|
|
echo "$url"
|
2021-08-29 12:00:18 +00:00
|
|
|
'')
|
|
|
|
(pkgs.writers.writeDashBin "cdel" ''
|
|
|
|
set -efu
|
|
|
|
path=$1
|
2021-08-31 20:44:27 +00:00
|
|
|
path=$(echo "/$path" | sed -E 's:/+:/:')
|
|
|
|
url=http://c.r$path
|
2021-08-29 12:00:18 +00:00
|
|
|
|
2021-08-31 20:44:27 +00:00
|
|
|
${pkgs.curl}/bin/curl -f -X DELETE "$url"
|
2021-08-29 12:00:18 +00:00
|
|
|
'')
|
|
|
|
];
|
|
|
|
}
|