Merge lp:~ogra/phablet-tools/phablet-tools-fix-phablet-network-spacechar-handling into lp:phablet-tools

Proposed by Oliver Grawert
Status: Merged
Approved by: Ricardo Salveti
Approved revision: 312
Merged at revision: 315
Proposed branch: lp:~ogra/phablet-tools/phablet-tools-fix-phablet-network-spacechar-handling
Merge into: lp:phablet-tools
Diff against target: 54 lines (+8/-8)
1 file modified
phablet-network (+8/-8)
To merge this branch: bzr merge lp:~ogra/phablet-tools/phablet-tools-fix-phablet-network-spacechar-handling
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+235108@code.launchpad.net

Commit message

phablet-network: support network files with spaces in their filename (LP: #1367180), make finding the active UUID not break on non-english locale settings, quieten down glib noise from nmcli on the device

Description of the change

phablet-network: support network files with spaces in their filename (LP: #1367180), make finding the active UUID not break on non-english locale settings, quieten down glib noise from nmcli on the device

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

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 2014-08-15 10:59:22 +0000
3+++ phablet-network 2014-09-18 11:48:47 +0000
4@@ -102,22 +102,22 @@
5 echo "No wireless adapter found, exiting"
6 exit 1
7 fi
8- network_active_uuid="$(nmcli -t -f name,uuid,devices,vpn con status | grep $wireless_adapter | egrep ':no$'| cut -d: -f2)"
9+ network_active_uuid="$(LC_ALL=C nmcli -t -f name,uuid,devices,vpn con status | grep $wireless_adapter | egrep ':no$'| cut -d: -f2)"
10 if [ -z "$network_active_uuid" ]
11 then
12 echo "No active wifi network connection, exiting"
13 exit 1
14 fi
15- network_file=$(sudo grep -H "$network_active_uuid" /etc/NetworkManager/system-connections/* | grep uuid | cut -f1 -d:)
16+ network_file=$(sudo grep -H "$network_active_uuid" $NETWORK_MANAGER/* | grep uuid | cut -f1 -d:)
17
18 echo "$network_file"
19 }
20
21 setup_connection() {
22 if [ -z "$OPTION_NETWORK_FILE" ]; then
23- network_file=$(find_active_network)
24+ network_file="$(find_active_network)"
25 else
26- network_file=$OPTION_NETWORK_FILE
27+ network_file="$OPTION_NETWORK_FILE"
28 fi
29
30 if [ ! -f "$network_file" ]
31@@ -128,11 +128,11 @@
32
33 echo Network file is $network_file
34
35- SSID="$(sudo grep ^ssid= $network_file|sed 's/^ssid=//')"
36- KEY="$(sudo grep ^psk= $network_file|sed 's/^psk=//')"
37+ SSID="$(sudo grep ^ssid= "$network_file"|sed 's/^ssid=//')"
38+ KEY="$(sudo grep ^psk= "$network_file"|sed 's/^psk=//')"
39
40 # No PSK ? Let's check for WEP
41- [ -z "$KEY" ] && KEY="$(sudo grep ^wep-key0= $network_file|sed 's/^wep-key0=//')"
42+ [ -z "$KEY" ] && KEY="$(sudo grep ^wep-key0= "$network_file"|sed 's/^wep-key0=//')"
43
44 # Still no key ?
45 if [ -z "$KEY" ]; then
46@@ -141,7 +141,7 @@
47 fi
48
49 echo Provisioning network on device
50- adb shell "nmcli device wifi connect ${SSID} password '${KEY}'"
51+ adb shell "nmcli device wifi connect ${SSID} password '${KEY}' 2>/dev/null"
52
53 echo
54 echo Network setup complete

Subscribers

People subscribed via source and target branches