vpn.lisp 410 B

1234567891011
  1. (in-package :stumpwm)
  2. (defun network-address (interface)
  3. (string-trim '(#\Newline)
  4. (run-shell-command
  5. (join (list "ip --json address"
  6. (format nil "jq --raw-output '.[] | select(.ifname == ~s) | .addr_info[] | select(.\"family\" == \"inet\") | .local'"
  7. interface))
  8. #\|)
  9. t)))