diff --git a/src/freedombone-utils-onion b/src/freedombone-utils-onion index 47dbe6a1..7ab00146 100755 --- a/src/freedombone-utils-onion +++ b/src/freedombone-utils-onion @@ -47,7 +47,7 @@ function wait_for_onion_service_base { onion_service_name="$1" sleep_ctr=0 - while [ $(onion_service_exists ${onion_service_name}) == "0" ]; do + while [[ $(onion_service_exists ${onion_service_name}) == "0" ]]; do sleep 1 sleep_ctr=$((sleep_ctr + 1)) if [ $sleep_ctr -gt 10 ]; then @@ -61,7 +61,7 @@ function wait_for_onion_service { wait_for_onion_service_base ${onion_service_name} - if [ $(onion_service_exists ${onion_service_name}) == "0" ]; then + if [[ $(onion_service_exists ${onion_service_name}) == "0" ]]; then # try a second time onion_update wait_for_onion_service_base ${onion_service_name} @@ -102,7 +102,7 @@ function add_onion_service { onion_service_port_from=$2 onion_service_port_to=$3 - if [ $(onion_service_exists ${onion_service_name}) == "1" ]; then + if [[ $(onion_service_exists ${onion_service_name}) == "1" ]]; then echo $(cat /var/lib/tor/hidden_service_${onion_service_name}/hostname) return fi @@ -122,7 +122,7 @@ function add_onion_service { function_check wait_for_onion_service wait_for_onion_service ${onion_service_name} - if [ $(onion_service_exists ${onion_service_name}) == "0" ]; then + if [[ $(onion_service_exists ${onion_service_name}) == "0" ]]; then echo $"${onion_service_name} onion site hostname not found" exit 76362 fi