pppoe convert to using a config file
mostly for ease of implementation but does mean we don't have username/password secrets on the command line
This commit is contained in:
parent
264d83c98d
commit
54d3415885
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
liminix
|
liminix
|
||||||
, lib
|
, lib
|
||||||
|
, output-template
|
||||||
, ppp
|
, ppp
|
||||||
, pppoe
|
, pppoe
|
||||||
, writeAshScript
|
, writeAshScript
|
||||||
@ -15,7 +16,7 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (liminix.services) longrun;
|
inherit (liminix.services) longrun;
|
||||||
inherit (lib) optional optionals;
|
inherit (lib) optional optionals concatStringsSep;
|
||||||
name = "${interface.name}.pppoe";
|
name = "${interface.name}.pppoe";
|
||||||
ip-up = writeAshScript "ip-up" {} ''
|
ip-up = writeAshScript "ip-up" {} ''
|
||||||
. ${serviceFns}
|
. ${serviceFns}
|
||||||
@ -61,8 +62,11 @@ longrun {
|
|||||||
inherit name;
|
inherit name;
|
||||||
run = ''
|
run = ''
|
||||||
. ${serviceFns}
|
. ${serviceFns}
|
||||||
|
mkdir -p /run/${name}
|
||||||
|
chmod 0700 /run/${name}
|
||||||
|
echo ${concatStringsSep " " ppp-options'} | ${output-template}/bin/output-template '{{' '}}' > /run/${name}/${name}.conf
|
||||||
echo Starting pppoe, pppd pid is $$
|
echo Starting pppoe, pppd pid is $$
|
||||||
exec ${ppp}/bin/pppd pty "${pppoe}/bin/pppoe ${timeoutOpt} -I $(output ${interface} ifname)" ${lib.concatStringsSep " " ppp-options'}
|
exec ${ppp}/bin/pppd pty "${pppoe}/bin/pppoe ${timeoutOpt} -I $(output ${interface} ifname)" file /run/${name}/${name}.conf
|
||||||
'';
|
'';
|
||||||
notification-fd = 10;
|
notification-fd = 10;
|
||||||
timeout-up = if lcpEcho.failure != null
|
timeout-up = if lcpEcho.failure != null
|
||||||
|
Loading…
Reference in New Issue
Block a user