[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
187/197: installer: Add procudure for starting a wireless interface.
From: |
Danny Milosavljevic |
Subject: |
187/197: installer: Add procudure for starting a wireless interface. |
Date: |
Mon, 3 Jul 2017 20:37:23 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit a8ad0c9bee38947b2cb2c6c5150d1f66fb5c7b2d
Author: John Darrington <address@hidden>
Date: Sun Feb 19 15:28:23 2017 +0100
installer: Add procudure for starting a wireless interface.
* gnu/system/installer/wireless.scm (start-interface): New procedure.
---
gnu/system/installer/wireless.scm | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/gnu/system/installer/wireless.scm
b/gnu/system/installer/wireless.scm
index 3e34e61..42b1a8f 100644
--- a/gnu/system/installer/wireless.scm
+++ b/gnu/system/installer/wireless.scm
@@ -24,6 +24,7 @@
#:use-module (gnu system installer misc)
#:use-module (gnu system installer utils)
#:use-module (ice-9 format)
+ #:use-module (ice-9 rdelim)
#:use-module (ice-9 match)
#:use-module (gurses menu)
#:use-module (gurses buttons)
@@ -245,6 +246,18 @@
+(define (start-interface config-file ifce)
+ (let ((pid-file (format #f "/wpspid-~a" ifce)))
+ (catch #t
+ (lambda () (kill (string->number
+ (read-line (open pid-file O_RDONLY))) SIGINT))
+ (lambda (key . args) #t))
+ (zero? (system* "wpa_supplicant"
+ "-c" config-file
+ "-P" pid-file
+ "-i" ifce
+ "-B"))))
+
(define (wireless-connect ifce access-point passphrase)
"Connect the wireless interface IFCE to ACCESS-POINT using the key
PASSPHRASE."
@@ -274,9 +287,5 @@ network={
(with-output-to-file "/dev/null"
(lambda ()
- (and (zero? (system* "wpa_supplicant"
- "-c" filename
- "-P" (format #f "/wpspid-~a" ifce)
- "-i" ifce
- "-B"))
+ (and (start-interface filename ifce)
(dhclient ifce))))))))
- 143/197: gurses: Add predicate to test if a complex char is blank., (continued)
- 143/197: gurses: Add predicate to test if a complex char is blank., Danny Milosavljevic, 2017/07/03
- 149/197: gurses: Add new procedure "word-endings"., Danny Milosavljevic, 2017/07/03
- 155/197: installer: Use _ instead of M_ for host-name-refresh., Danny Milosavljevic, 2017/07/03
- 160/197: installer: New convenience procedures., Danny Milosavljevic, 2017/07/03
- 158/197: installer: Correct placement of gettext call., Danny Milosavljevic, 2017/07/03
- 163/197: gurses: Cache the windows of buttons., Danny Milosavljevic, 2017/07/03
- 172/197: gurses: Update the cursor position when posting the form., Danny Milosavljevic, 2017/07/03
- 165/197: installer: New procedure key-value-slurp., Danny Milosavljevic, 2017/07/03
- 175/197: gurses: Don't crash if asked for an item by an invalid index., Danny Milosavljevic, 2017/07/03
- 171/197: installer: New page to edit user accounts., Danny Milosavljevic, 2017/07/03
- 187/197: installer: Add procudure for starting a wireless interface.,
Danny Milosavljevic <=
- 192/197: installer: Only build if guile-ncurses is available., Danny Milosavljevic, 2017/07/03
- 68/197: installer: Add new page to set the system role., Danny Milosavljevic, 2017/07/03
- 117/197: installer: Remove unnecessary "begin"., Danny Milosavljevic, 2017/07/03
- 113/197: installer: Explicitly set the #:panel parameter for window creation procedures., Danny Milosavljevic, 2017/07/03
- 122/197: gurses: Populate the choices box in forms., Danny Milosavljevic, 2017/07/03
- 128/197: installer: Remove redundant list of file system types., Danny Milosavljevic, 2017/07/03
- 115/197: installer: New procedure refresh*., Danny Milosavljevic, 2017/07/03
- 153/197: installer: Add optional arguments to addstr*., Danny Milosavljevic, 2017/07/03
- 97/197: installer: Whitespace changes only, Danny Milosavljevic, 2017/07/03
- 139/197: installer: Allow file system specifications to be removed., Danny Milosavljevic, 2017/07/03