diff --git a/nongnu/services/vpn.scm b/nongnu/services/vpn.scm index 0bd26c7..b76cf03 100644 --- a/nongnu/services/vpn.scm +++ b/nongnu/services/vpn.scm @@ -29,16 +29,26 @@ (name 'join) (documentation "Join a network") (procedure #~(lambda (running network) - (let ((zerotier-cli (string-append #$zerotier "/sbin/zerotier-cli"))) - (invoke zerotier-cli "join" network)))))) + (let* ((zerotier-cli (string-append #$zerotier "/sbin/zerotier-cli")) + (cmd (string-join (list zerotier-cli "join" network))) + (port (open-input-pipe cmd)) + (str (get-string-all port))) + (display str) + (status:exit-val (close-pipe port))))))) (define %zerotier-action-leave (shepherd-action (name 'leave) (documentation "Leave a network") (procedure #~(lambda (running network) - (let ((zerotier-cli (string-append #$zerotier "/sbin/zerotier-cli"))) - (invoke zerotier-cli "leave" network)))))) + (let* ((zerotier-cli (string-append #$zerotier "/sbin/zerotier-cli")) + (cmd (string-join (list zerotier-cli "leave" network))) + (port (open-input-pipe cmd)) + (str (get-string-all port))) + (display str) + (status:exit-val (close-pipe port))))))) + + (define zerotier-one-shepherd-service (lambda (config)