diff options
author | tv <tv@krebsco.de> | 2021-09-28 22:48:17 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2021-09-28 22:48:17 +0200 |
commit | ed2c6bd9792afbc433ae4eb23f40e17b90420f99 (patch) | |
tree | 289de32dd7f58f46accf7ad25ed184db5aa45198 /krebs/5pkgs/simple/cyberlocker-tools/default.nix | |
parent | 20e358043546482acfa8c6134f095c1a64ef144d (diff) | |
parent | e151cfd3298120ec541987d4beb155e18335a0d8 (diff) |
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs/5pkgs/simple/cyberlocker-tools/default.nix')
-rw-r--r-- | krebs/5pkgs/simple/cyberlocker-tools/default.nix | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/krebs/5pkgs/simple/cyberlocker-tools/default.nix b/krebs/5pkgs/simple/cyberlocker-tools/default.nix index d43be1d6..6e6563fb 100644 --- a/krebs/5pkgs/simple/cyberlocker-tools/default.nix +++ b/krebs/5pkgs/simple/cyberlocker-tools/default.nix @@ -5,15 +5,19 @@ pkgs.symlinkJoin { (pkgs.writers.writeDashBin "cput" '' set -efu path=''${1:-$(hostname)} + path=$(echo "/$path" | sed -E 's:/+:/:') + url=http://c.r$path - ${pkgs.curl}/bin/curl -fSs --data-binary @- "http://c.r/$path" - echo "http://c.r/$path" + ${pkgs.curl}/bin/curl -fSs --data-binary @- "$url" + echo "$url" '') (pkgs.writers.writeDashBin "cdel" '' set -efu path=$1 + path=$(echo "/$path" | sed -E 's:/+:/:') + url=http://c.r$path - ${pkgs.curl}/bin/curl -f -X DELETE "http://c.r/$path" + ${pkgs.curl}/bin/curl -f -X DELETE "$url" '') ]; } |