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.master
parent
89a0d00a38
commit
8897603ad0
|
@ -55,7 +55,8 @@ gateway."
|
||||||
;; Return #t if successfully started.
|
;; Return #t if successfully started.
|
||||||
(and (zero? (system* (string-append #$inetutils
|
(and (zero? (system* (string-append #$inetutils
|
||||||
"/bin/ifconfig")
|
"/bin/ifconfig")
|
||||||
#$interface #$ip "up"))
|
"-i" #$interface "-A" #$ip
|
||||||
|
"-i" #$interface "--up"))
|
||||||
#$(if gateway
|
#$(if gateway
|
||||||
#~(zero? (system* (string-append #$net-tools
|
#~(zero? (system* (string-append #$net-tools
|
||||||
"/sbin/route")
|
"/sbin/route")
|
||||||
|
@ -77,8 +78,11 @@ gateway."
|
||||||
;; Return #f is successfully stopped.
|
;; Return #f is successfully stopped.
|
||||||
(not (and (system* (string-append #$inetutils "/bin/ifconfig")
|
(not (and (system* (string-append #$inetutils "/bin/ifconfig")
|
||||||
#$interface "down")
|
#$interface "down")
|
||||||
(system* (string-append #$net-tools "/sbin/route")
|
#$(if gateway
|
||||||
"del" "-net" "default")))))
|
#~(system* (string-append #$net-tools
|
||||||
|
"/sbin/route")
|
||||||
|
"del" "-net" "default")
|
||||||
|
#t)))))
|
||||||
(respawn? #f)))))
|
(respawn? #f)))))
|
||||||
|
|
||||||
;;; networking.scm ends here
|
;;; networking.scm ends here
|
||||||
|
|
Loading…
Reference in New Issue