nixos/clatd: use clat-dev if it exists in settings

Otherwise, fallback to the default interface name `clat`.
This commit is contained in:
Jared Baur 2024-11-20 20:06:59 -08:00 committed by tomf
parent 7665f6cb34
commit 7b87a185a8

View File

@ -86,7 +86,7 @@ in
type = "basic";
# https://github.com/toreanderson/clatd/blob/master/scripts/clatd.networkmanager
source = pkgs.writeShellScript "restart-clatd" ''
[ "$DEVICE_IFACE" = "clat" ] && exit 0
[ "$DEVICE_IFACE" = "${cfg.settings.clat-dev or "clat"}" ] && exit 0
[ "$2" != "up" ] && [ "$2" != "down" ] && exit 0
${pkgs.systemd}/bin/systemctl restart clatd.service
'';