~phablet-team/phablet-tools/trunk

« back to all changes in this revision

Viewing changes to phablet-network

  • Committer: Selene Scriven
  • Date: 2015-03-03 09:24:02 UTC
  • mto: This revision was merged to the branch mainline in revision 357.
  • Revision ID: selene.scriven@canonical.com-20150303092402-z2vqc812wr6wrepi
Simpler, better method.  Try CLI option, then default dotfile, then auto-detect.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
usage: $0 [OPTIONS]
28
28
 
29
29
Copies ACTIVE network manager connection into device
 
30
(or uses NM-format wifi config from $DEFAULT_NETWORK_FILE)
30
31
 
31
32
OPTIONS:
32
33
  -h    Show this message
42
43
}
43
44
 
44
45
OPTION_NETWORK_FILE=""
 
46
DEFAULT_NETWORK_FILE="$HOME/.phablet-network"
45
47
SKIP_SETUP=""
46
48
SKIP_WAIT=""
47
49
WAIT_TIMEOUT="80s"
113
115
}
114
116
 
115
117
setup_connection() {
116
 
    if [ -z "$OPTION_NETWORK_FILE" ]; then
 
118
    if [ ! -z "$OPTION_NETWORK_FILE" ]; then
 
119
        network_file="$OPTION_NETWORK_FILE"
 
120
    elif [ -f "$DEFAULT_NETWORK_FILE" ]; then
 
121
        network_file="$DEFAULT_NETWORK_FILE"
 
122
    else
117
123
        network_file="$(find_active_network)"
118
 
    else
119
 
        network_file="$OPTION_NETWORK_FILE"
120
124
    fi
121
125
 
122
126
    if [ ! -f "$network_file" ]