summaryrefslogtreecommitdiffstats
path: root/lass/4lib
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-09-18 03:00:29 +0200
committerlassulus <lass@aidsballs.de>2015-09-18 03:00:29 +0200
commit79f0abfdfc996882306d65cc1b815286c2c92648 (patch)
treed8c2c5aa8c2bf8d7303e97c16c87407fd81f893b /lass/4lib
parentb35fd2bb734e0d857ba6d673e924affafe1475e6 (diff)
lass 4: add getDefaultGateway helper function
Diffstat (limited to 'lass/4lib')
-rw-r--r--lass/4lib/default.nix4
1 files changed, 4 insertions, 0 deletions
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"]);
+
}