Commit 1d6d6cb1 authored by Arie Peterson's avatar Arie Peterson 🐚
Browse files

Use bash keyword [[ consistently

parent 05478504
......@@ -90,7 +90,7 @@ ghostAction() {
esac
local url="${server}/api/v2/disks/$diskImage/actions"
debug "curling cosmos: $url"
if [ -z "$vps" ]
if [[ -z "$vps" ]]
then
local data="{\"type\": \"$action\"}"
else
......@@ -101,7 +101,7 @@ ghostAction() {
debug "output: "
debug $(jq '.' <<<"$response")
errorOccurred=$(jq '."error"' <<<"$response")
if [ "$errorOccurred" = "true" ]
if [[ "$errorOccurred" = "true" ]]
then
errorMessage=$(jq '."message"' <<<"$response")
errorMessage="The Cosmos2 api call returned an error: $errorMessage"
......@@ -142,7 +142,7 @@ domount() {
# Use the `blkid` program to scan the device for an existing filesystem.
existingFileSystem=$(blkid "$device")
debug "blkid: $existingFileSystem"
if [ -z "$existingFileSystem" ]
if [[ -z "$existingFileSystem" ]]
then
debug "No existing filesystem; creating one."
mkfs.xfs "$device" >/dev/null 2>&1
......@@ -176,7 +176,8 @@ unmount() {
# This is the command Kubernetes wants us to perform.
op=$1
if [ "$op" = "init" ]; then
if [[ "$op" = "init" ]]
then
debug "init $@"
output "{\"status\":\"Success\",\"capabilities\":{\"attach\":false}}"
exit 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment