Tidying wifi command
This commit is contained in:
parent
6a9bd38440
commit
94053f6bed
|
@ -117,7 +117,7 @@ if [[ $command_options == "menuconfig"* ]]; then
|
||||||
fi
|
fi
|
||||||
rm $interactive_file
|
rm $interactive_file
|
||||||
else
|
else
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -810,7 +810,7 @@ function validate_freedns_code {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the commandline options
|
# Get the commandline options
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ function regenerate_dh_keys {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -293,7 +293,7 @@ function mesh_router_setup_script {
|
||||||
echo 'WIFI_CHANNEL=9' >> $mesh_script_filename
|
echo 'WIFI_CHANNEL=9' >> $mesh_script_filename
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ function mesh_tox_client_toxic_from_repo {
|
||||||
echo "Toxic Installed."
|
echo "Toxic Installed."
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ function export_to_keepass {
|
||||||
echo $"Exported $filename"
|
echo $"Exported $filename"
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ function show_help {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the commandline options
|
# Get the commandline options
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ function renew_startssl {
|
||||||
${PROJECT_NAME}-pin-cert $HOSTNAME remove
|
${PROJECT_NAME}-pin-cert $HOSTNAME remove
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -1328,7 +1328,7 @@ function show_help {
|
||||||
|
|
||||||
|
|
||||||
# Get the commandline options
|
# Get the commandline options
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -1217,7 +1217,7 @@ function test_stig {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ function show_help {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# > 1 ]]
|
while [ $# -gt 1 ]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
@ -144,11 +144,11 @@ if [ ${NETWORKS_INTERACTIVE} ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! ${wifi_interface_specified} ]; then
|
if [ ! ${wifi_interface_specified} ]; then
|
||||||
if [ ! $WAIT_SEC ]; then
|
if [ ! "$WAIT_SEC" ]; then
|
||||||
wpa_action ${WIFI_INTERFACE} stop
|
wpa_action "${WIFI_INTERFACE}" stop
|
||||||
wpa_cli -i ${WIFI_INTERFACE} terminate
|
wpa_cli -i "${WIFI_INTERFACE}" terminate
|
||||||
else
|
else
|
||||||
sleep ${WAIT_SEC}
|
sleep "${WAIT_SEC}"
|
||||||
fi
|
fi
|
||||||
update_wifi_adaptors
|
update_wifi_adaptors
|
||||||
if [ ! $IFACE ]; then
|
if [ ! $IFACE ]; then
|
||||||
|
@ -166,7 +166,7 @@ if [ ${WIFI_DISABLE} ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
|
if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
|
||||||
if [ -f ${WIFI_NETWORKS_FILE} ]; then
|
if [ -f "${WIFI_NETWORKS_FILE}" ]; then
|
||||||
wifi_established=
|
wifi_established=
|
||||||
wifi_retry_ctr=0
|
wifi_retry_ctr=0
|
||||||
while [ ! $wifi_established ]; do
|
while [ ! $wifi_established ]; do
|
||||||
|
@ -184,7 +184,7 @@ if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
|
||||||
fi
|
fi
|
||||||
# has the limit of retries been reached?
|
# has the limit of retries been reached?
|
||||||
wifi_retry_ctr=$((wifi_retry_ctr+1))
|
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
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -198,14 +198,13 @@ if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! ${WIFI_SSID} ]; then
|
if [ ! "${WIFI_SSID}" ]; then
|
||||||
echo $'No SSID given'
|
echo $'No SSID given'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${WIFI_HOTSPOT} != 'no' ]]; then
|
if [[ ${WIFI_HOTSPOT} != 'no' ]]; then
|
||||||
hotspot_on
|
if ! hotspot_on; then
|
||||||
if [ ! "$?" = "0" ]; then
|
|
||||||
exit "$?"
|
exit "$?"
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -214,7 +213,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$WIFI_TYPE" != 'none' && "$WIFI_TYPE" != 'open' ]]; then
|
if [[ "$WIFI_TYPE" != 'none' && "$WIFI_TYPE" != 'open' ]]; then
|
||||||
if [ ! $WIFI_PASSPHRASE ]; then
|
if [ ! "$WIFI_PASSPHRASE" ]; then
|
||||||
echo $'No wifi passphrase was given'
|
echo $'No wifi passphrase was given'
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue