Tinc: Difference between revisions
imported>Makefu pre -> syntaxHighlight |
imported>Joepie91 Fix formatting for tinc-up/tinc-down example |
||
Line 86: | Line 86: | ||
<syntaxHighlight lang=nix># for heinz | <syntaxHighlight lang=nix># for heinz | ||
environment.etc | environment.etc = { | ||
"tinc/private/tinc-up".source = pkgs.writeScript "tinc-up-private" '' | |||
#!${pkgs.stdenv.shell} | |||
''; | ${pkgs.nettools}/bin/ifconfig $INTERFACE 10.1.1.25 netmask 255.255.255.0 | ||
''; | |||
"tinc/private/tinc-down".source = pkgs.writeScript "tinc-down-private" '' | |||
#!${pkgs.stdenv.shell} | |||
'';</syntaxHighlight> | /run/wrappers/bin/sudo ${pkgs.nettools}/bin/ifconfig $INTERFACE down | ||
''; | |||
};</syntaxHighlight> | |||
For the <code>tinc-down</code> we need to use sudo, because the user <code>tinc.private</code> who starts the service is not able to tear down the interface. | For the <code>tinc-down</code> we need to use sudo, because the user <code>tinc.private</code> who starts the service is not able to tear down the interface. | ||