chore(lint): Linted scripts, yaml and configs

This commit is contained in:
2023-07-27 13:57:15 +03:00
parent a864d31e84
commit d7106ae28f
11 changed files with 30 additions and 50 deletions

View File

@@ -5,7 +5,8 @@
#
# Modified by Ismo Vuorinen <https://github.com/ivuorinen> 2023
__pushover_usage() {
__pushover_usage()
{
printf "pushover <options> <message>\n"
printf " -c <callback>\n"
printf " -d <device>\n"
@@ -22,7 +23,8 @@ __pushover_usage() {
return 1
}
__pushover_opt_field() {
__pushover_opt_field()
{
field=$1
shift
value="${*}"
@@ -31,7 +33,8 @@ __pushover_opt_field() {
fi
}
__pushover_send_message() {
__pushover_send_message()
{
device="${1:-}"
curl_cmd="\"${CURL}\" -s -S \
@@ -71,8 +74,7 @@ devices="${devices} ${device}"
optstring="c:d:D:e:f:p:r:t:T:s:u:U:a:h"
OPTIND=1
while getopts ${optstring} c
do
while getopts ${optstring} c; do
case ${c} in
c)
callback="${OPTARG}"
@@ -117,7 +119,7 @@ do
;;
esac
done
shift $((OPTIND-1))
shift $((OPTIND - 1))
if [ "$#" -lt 1 ]; then
__pushover_usage
@@ -141,9 +143,8 @@ else
__pushover_send_message "${device}"
r=${?}
if [ "${r}" -ne 0 ]; then
break;
break
fi
done
fi
exit "${r}"

View File

@@ -14,7 +14,8 @@ file_2="$2"
# return sha256sum for file
# $1 - filename (string)
get_sha256sum() {
get_sha256sum()
{
sha256sum "$1" | head -c 64
}
@@ -22,11 +23,13 @@ get_sha256sum() {
echo "Usage: $0 file1.sh file2.sh" && exit 1
}
msg() {
msg()
{
[[ "$VERBOSE" -eq 1 ]] && echo "$1"
}
error() {
error()
{
msg "(!) ERROR: $1" && exit 1
}
@@ -45,6 +48,5 @@ if [ "$file_1_hash" != "$file_2_hash" ]; then
error "Files do not match"
else
msg "(*) Success: Files do match"
exit 0;
exit 0
fi