diff --git a/src/freedombone b/src/freedombone index 5e69cc2b..d3ee8164 100755 --- a/src/freedombone +++ b/src/freedombone @@ -117,7 +117,7 @@ if [[ $command_options == "menuconfig"* ]]; then fi rm $interactive_file else - while [[ $# > 1 ]] + while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-addcert b/src/freedombone-addcert index 5b6ee2f9..b37575ef 100755 --- a/src/freedombone-addcert +++ b/src/freedombone-addcert @@ -85,7 +85,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-addemail b/src/freedombone-addemail index e5ee8080..348f10ce 100755 --- a/src/freedombone-addemail +++ b/src/freedombone-addemail @@ -47,7 +47,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-addlist b/src/freedombone-addlist index 9bbecd30..3e19c9e9 100755 --- a/src/freedombone-addlist +++ b/src/freedombone-addlist @@ -47,7 +47,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-clientcert b/src/freedombone-clientcert index 72fda3f8..6c9750e1 100755 --- a/src/freedombone-clientcert +++ b/src/freedombone-clientcert @@ -57,7 +57,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-config b/src/freedombone-config index 93a4b8d1..70db151c 100755 --- a/src/freedombone-config +++ b/src/freedombone-config @@ -810,7 +810,7 @@ function validate_freedns_code { } # Get the commandline options -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-dhparam b/src/freedombone-dhparam index ff5cc3e9..80392ca4 100755 --- a/src/freedombone-dhparam +++ b/src/freedombone-dhparam @@ -179,7 +179,7 @@ function regenerate_dh_keys { done } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-ignore b/src/freedombone-ignore index d8ba372f..b3817f80 100755 --- a/src/freedombone-ignore +++ b/src/freedombone-ignore @@ -46,7 +46,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-image b/src/freedombone-image index 9275230e..7d3f1948 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -293,7 +293,7 @@ function mesh_router_setup_script { echo 'WIFI_CHANNEL=9' >> $mesh_script_filename } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-keydrive b/src/freedombone-keydrive index 4a01b9ee..c0b3f6e4 100755 --- a/src/freedombone-keydrive +++ b/src/freedombone-keydrive @@ -48,7 +48,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-mesh-install b/src/freedombone-mesh-install index 9aef8f97..74145c28 100755 --- a/src/freedombone-mesh-install +++ b/src/freedombone-mesh-install @@ -275,7 +275,7 @@ function mesh_tox_client_toxic_from_repo { echo "Toxic Installed." } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-pass b/src/freedombone-pass index a0ceee80..cbf77d94 100755 --- a/src/freedombone-pass +++ b/src/freedombone-pass @@ -188,7 +188,7 @@ function export_to_keepass { echo $"Exported $filename" } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-recoverkey b/src/freedombone-recoverkey index 22c9b7ae..2c5e3c29 100755 --- a/src/freedombone-recoverkey +++ b/src/freedombone-recoverkey @@ -53,7 +53,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-remote b/src/freedombone-remote index c3d5708a..8089f82d 100755 --- a/src/freedombone-remote +++ b/src/freedombone-remote @@ -75,7 +75,7 @@ function show_help { } # Get the commandline options -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-renew-cert b/src/freedombone-renew-cert index 3fdc35b3..2bb88dee 100755 --- a/src/freedombone-renew-cert +++ b/src/freedombone-renew-cert @@ -172,7 +172,7 @@ function renew_startssl { ${PROJECT_NAME}-pin-cert $HOSTNAME remove } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-rmemail b/src/freedombone-rmemail index 50c93ecc..848d9ebf 100755 --- a/src/freedombone-rmemail +++ b/src/freedombone-rmemail @@ -43,7 +43,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-rmlist b/src/freedombone-rmlist index 1e2ce43c..1e0e241e 100755 --- a/src/freedombone-rmlist +++ b/src/freedombone-rmlist @@ -45,7 +45,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-sec b/src/freedombone-sec index 733028fa..8d0420e1 100755 --- a/src/freedombone-sec +++ b/src/freedombone-sec @@ -1328,7 +1328,7 @@ function show_help { # Get the commandline options -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-splitkey b/src/freedombone-splitkey index 92024835..22270a79 100755 --- a/src/freedombone-splitkey +++ b/src/freedombone-splitkey @@ -55,7 +55,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-template b/src/freedombone-template index 2fc3c2c8..52728414 100755 --- a/src/freedombone-template +++ b/src/freedombone-template @@ -74,7 +74,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-tests b/src/freedombone-tests index 6ca1e824..7ab50e9d 100755 --- a/src/freedombone-tests +++ b/src/freedombone-tests @@ -1217,7 +1217,7 @@ function test_stig { fi } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-unignore b/src/freedombone-unignore index 8ef34724..e0cb3c12 100755 --- a/src/freedombone-unignore +++ b/src/freedombone-unignore @@ -46,7 +46,7 @@ function show_help { exit 0 } -while [[ $# > 1 ]] +while [ $# -gt 1 ] do key="$1" diff --git a/src/freedombone-wifi b/src/freedombone-wifi index 7fb58548..c154f49a 100755 --- a/src/freedombone-wifi +++ b/src/freedombone-wifi @@ -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