From 79f0abfdfc996882306d65cc1b815286c2c92648 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 18 Sep 2015 03:00:29 +0200 Subject: lass 4: add getDefaultGateway helper function --- lass/4lib/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lass') diff --git a/lass/4lib/default.nix b/lass/4lib/default.nix index 21a083d1a..2e493177d 100644 --- a/lass/4lib/default.nix +++ b/lass/4lib/default.nix @@ -17,4 +17,8 @@ krebs // rec { ln -s ${pkgs.writeScript name content} $out/bin/${name} ''; }; + + getDefaultGateway = ip: + concatStringsSep "." (take 3 (splitString "." ip) ++ ["1"]); + } -- cgit v1.2.3