dip

old school recipes for janitorial snafu.
git clone git://git.ricketyspace.net/dip.git
Log | Files | Refs

commit 2bb48cf898073a614498f53611ab9f3836f9a5c0
parent 52a785467bda78e59b2c82aecd01ee864aee6984
Author: rsiddharth <s@ricketyspace.net>
Date:   Thu, 24 May 2018 22:13:18 +0000

usr: Add fdg (from dotfiles).

Diffstat:
usr/local/bin/fdg | 30++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+), 0 deletions(-)

diff --git a/usr/local/bin/fdg b/usr/local/bin/fdg @@ -0,0 +1,30 @@ +#!/home/s/.guix-profile/bin/guile \ +-e main -s +!# +;;;; coding: utf-8 +;;;; license: GPL-3.0-or-later +;;;; copyright 2016 rsiddharth <s@ricketyspace.net> + +(define (dest) + "destination to dump file(s) to." + (let ((d (getenv "FDUMP_DEST"))) + (if d d (begin (display "Error: FDUMP_DEST not set!\n") + (exit #f))))) + +;;; path to ssh private key. +(define (ident) + (getenv "FDUMP_ID")) + +;;; scp command. +(define scp "scp") + +(define (dump file) + "dump a file." + (let ((d (dest))) + (if (ident) + (system* scp "-i" (ident) file d) + (system* scp file d)))) + +;;; main function. +(define (main srcs) + (map dump (cdr srcs)))