Provisioning: improve use of bash conditionals

 * use (( )) for numeric comparisons
 * don't put commands in [[ ]]
 * quote $variables in [[ ]]

also use ${somename} in preference to $somename