Merge lp:~toykeeper/phablet-tools/phablet-network-no-nm into lp:phablet-tools

Proposed by Selene Scriven on 2015-03-03
Status: Merged
Approved by: Oliver Grawert on 2015-03-03
Approved revision: 338
Merged at revision: 357
Proposed branch: lp:~toykeeper/phablet-tools/phablet-network-no-nm
Merge into: lp:phablet-tools
Diff against target: 35 lines (+7/-3)
1 file modified
phablet-network (+7/-3)
To merge this branch: bzr merge lp:~toykeeper/phablet-tools/phablet-network-no-nm
Reviewer Review Type Date Requested Status
Robert Bruce Park (community) Approve on 2016-05-03
PS Jenkins bot continuous-integration Approve on 2015-03-03
Oliver Grawert 2015-03-03 Approve on 2015-03-03
Review via email: mp+251564@code.launchpad.net

Commit Message

This fixes Bug #1427559 (phablet-network requires NetworkManager).

It adds support for an optional dotfile to specify the data the script would otherwise try to detect from NetworkManager. With no dotfile, the script acts the same as before, but by adding a dotfile it allows people to use phablet-network in half a dozen corner cases which would otherwise fail.

Description of the Change

This fixes Bug #1427559 (phablet-network requires NetworkManager).

It adds support for an optional dotfile to specify the data the script would otherwise try to detect from NetworkManager. With no dotfile, the script acts the same as before, but by adding a dotfile it allows people to use phablet-network in half a dozen corner cases which would otherwise fail.

To post a comment you must log in.
337. By Selene Scriven on 2015-03-03

reverted previous change, using a different method

338. By Selene Scriven on 2015-03-03

Simpler, better method. Try CLI option, then default dotfile, then auto-detect.

Oliver Grawert (ogra) wrote :

looks good ...

review: Approve
Robert Bruce Park (robru) wrote :

Minor nitpick.

review: Needs Fixing
Robert Bruce Park (robru) wrote :

ooops, nm, lgtm.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phablet-network'
2--- phablet-network 2015-02-10 14:50:47 +0000
3+++ phablet-network 2015-03-03 09:25:01 +0000
4@@ -27,6 +27,7 @@
5 usage: $0 [OPTIONS]
6
7 Copies ACTIVE network manager connection into device
8+(or uses NM-format wifi config from $DEFAULT_NETWORK_FILE)
9
10 OPTIONS:
11 -h Show this message
12@@ -42,6 +43,7 @@
13 }
14
15 OPTION_NETWORK_FILE=""
16+DEFAULT_NETWORK_FILE="$HOME/.phablet-network"
17 SKIP_SETUP=""
18 SKIP_WAIT=""
19 WAIT_TIMEOUT="80s"
20@@ -113,10 +115,12 @@
21 }
22
23 setup_connection() {
24- if [ -z "$OPTION_NETWORK_FILE" ]; then
25+ if [ ! -z "$OPTION_NETWORK_FILE" ]; then
26+ network_file="$OPTION_NETWORK_FILE"
27+ elif [ -f "$DEFAULT_NETWORK_FILE" ]; then
28+ network_file="$DEFAULT_NETWORK_FILE"
29+ else
30 network_file="$(find_active_network)"
31- else
32- network_file="$OPTION_NETWORK_FILE"
33 fi
34
35 if [ ! -f "$network_file" ]

Subscribers

People subscribed via source and target branches