Tidying wifi command

This commit is contained in:
Bob Mottram 2018-02-25 11:04:13 +00:00
parent 6a9bd38440
commit 94053f6bed
23 changed files with 32 additions and 33 deletions

View File

@ -117,7 +117,7 @@ if [[ $command_options == "menuconfig"* ]]; then
fi
rm $interactive_file
else
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -85,7 +85,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -47,7 +47,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -47,7 +47,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -57,7 +57,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -810,7 +810,7 @@ function validate_freedns_code {
}
# Get the commandline options
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -179,7 +179,7 @@ function regenerate_dh_keys {
done
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -46,7 +46,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -293,7 +293,7 @@ function mesh_router_setup_script {
echo 'WIFI_CHANNEL=9' >> $mesh_script_filename
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -48,7 +48,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -275,7 +275,7 @@ function mesh_tox_client_toxic_from_repo {
echo "Toxic Installed."
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -188,7 +188,7 @@ function export_to_keepass {
echo $"Exported $filename"
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -53,7 +53,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -75,7 +75,7 @@ function show_help {
}
# Get the commandline options
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -172,7 +172,7 @@ function renew_startssl {
${PROJECT_NAME}-pin-cert $HOSTNAME remove
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -43,7 +43,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -45,7 +45,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -1328,7 +1328,7 @@ function show_help {
# Get the commandline options
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -55,7 +55,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -74,7 +74,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -1217,7 +1217,7 @@ function test_stig {
fi
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -46,7 +46,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"

View File

@ -75,7 +75,7 @@ function show_help {
exit 0
}
while [[ $# > 1 ]]
while [ $# -gt 1 ]
do
key="$1"
@ -144,11 +144,11 @@ if [ ${NETWORKS_INTERACTIVE} ]; then
fi
if [ ! ${wifi_interface_specified} ]; then
if [ ! $WAIT_SEC ]; then
wpa_action ${WIFI_INTERFACE} stop
wpa_cli -i ${WIFI_INTERFACE} terminate
if [ ! "$WAIT_SEC" ]; then
wpa_action "${WIFI_INTERFACE}" stop
wpa_cli -i "${WIFI_INTERFACE}" terminate
else
sleep ${WAIT_SEC}
sleep "${WAIT_SEC}"
fi
update_wifi_adaptors
if [ ! $IFACE ]; then
@ -166,7 +166,7 @@ if [ ${WIFI_DISABLE} ]; then
fi
if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
if [ -f ${WIFI_NETWORKS_FILE} ]; then
if [ -f "${WIFI_NETWORKS_FILE}" ]; then
wifi_established=
wifi_retry_ctr=0
while [ ! $wifi_established ]; do
@ -184,7 +184,7 @@ if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
fi
# has the limit of retries been reached?
wifi_retry_ctr=$((wifi_retry_ctr+1))
if [ ${wifi_retry_ctr} -ge ${WIFI_MAX_RETRIES} ]; then
if [ ${wifi_retry_ctr} -ge "${WIFI_MAX_RETRIES}" ]; then
break
fi
done
@ -198,14 +198,13 @@ if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
fi
fi
if [ ! ${WIFI_SSID} ]; then
if [ ! "${WIFI_SSID}" ]; then
echo $'No SSID given'
exit 1
fi
if [[ ${WIFI_HOTSPOT} != 'no' ]]; then
hotspot_on
if [ ! "$?" = "0" ]; then
if ! hotspot_on; then
exit "$?"
fi
exit 0
@ -214,7 +213,7 @@ else
fi
if [[ "$WIFI_TYPE" != 'none' && "$WIFI_TYPE" != 'open' ]]; then
if [ ! $WIFI_PASSPHRASE ]; then
if [ ! "$WIFI_PASSPHRASE" ]; then
echo $'No wifi passphrase was given'
exit 2
fi