treewide: Format with shellcheck, jsonlint and yamllint
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# Simple script for uploading a base64 encoded image into our database. For
|
||||
# grafana business image panels.
|
||||
|
||||
if [ $# -ne 2 ]
|
||||
if [[ $# -ne 2 ]]
|
||||
then
|
||||
echo "Usage: $0 <image-name> <file>.png"
|
||||
exit 1
|
||||
@@ -12,9 +12,9 @@ fi
|
||||
filename=$1
|
||||
file=$2
|
||||
|
||||
if [ ! -e $file ]
|
||||
if [[ ! -e "${file}" ]]
|
||||
then
|
||||
echo "file $file does not exist"
|
||||
echo "file ${file} does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -22,9 +22,9 @@ function create_image() {
|
||||
local filename=$1
|
||||
local data=$2
|
||||
cat << EOF
|
||||
INSERT INTO images VALUES('$filename', '$data');
|
||||
INSERT INTO images VALUES('${filename}', '${data}');
|
||||
EOF
|
||||
}
|
||||
|
||||
data=$(cat $file | base64 -w0)
|
||||
create_image $filename $data
|
||||
data=$(base64 -w0 < "${file}")
|
||||
create_image "${filename}" "${data}"
|
||||
|
||||
Reference in New Issue
Block a user