This repository has no description
599 B
28 lines
1# Copied from stockholm krebs/5pkgs/simple/cyberlocker-tools (cc283503).
2{
3 curl,
4 symlinkJoin,
5 writers,
6}:
7symlinkJoin {
8 name = "cyberlocker-tools";
9 paths = [
10 (writers.writeDashBin "cput" ''
11 set -efu
12 path=''${1:-$(hostname)}
13 path=$(echo "/$path" | sed -E 's:/+:/:')
14 url=http://c.r$path
15
16 ${curl}/bin/curl -fSs --data-binary @- "$url"
17 echo "$url"
18 '')
19 (writers.writeDashBin "cdel" ''
20 set -efu
21 path=$1
22 path=$(echo "/$path" | sed -E 's:/+:/:')
23 url=http://c.r$path
24
25 ${curl}/bin/curl -f -X DELETE "$url"
26 '')
27 ];
28}