mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 06:06:53 -05:00
services: networking: Set interfaces up; delete default route only when needed.
* gnu/services/networking.scm (static-networking-service): Use -i, -A, and --up with Inetutils' ifconfig. Do 'route del -net default' only when GATEWAY is true.
This commit is contained in:
parent
89a0d00a38
commit
8897603ad0
1 changed files with 7 additions and 3 deletions
|
@ -55,7 +55,8 @@ (define* (static-networking-service interface ip
|
|||
;; Return #t if successfully started.
|
||||
(and (zero? (system* (string-append #$inetutils
|
||||
"/bin/ifconfig")
|
||||
#$interface #$ip "up"))
|
||||
"-i" #$interface "-A" #$ip
|
||||
"-i" #$interface "--up"))
|
||||
#$(if gateway
|
||||
#~(zero? (system* (string-append #$net-tools
|
||||
"/sbin/route")
|
||||
|
@ -77,8 +78,11 @@ (define* (static-networking-service interface ip
|
|||
;; Return #f is successfully stopped.
|
||||
(not (and (system* (string-append #$inetutils "/bin/ifconfig")
|
||||
#$interface "down")
|
||||
(system* (string-append #$net-tools "/sbin/route")
|
||||
"del" "-net" "default")))))
|
||||
#$(if gateway
|
||||
#~(system* (string-append #$net-tools
|
||||
"/sbin/route")
|
||||
"del" "-net" "default")
|
||||
#t)))))
|
||||
(respawn? #f)))))
|
||||
|
||||
;;; networking.scm ends here
|
||||
|
|
Loading…
Reference in a new issue