From 27d35fd39ad1fbe57fac5626ed4ad4c61ed085c2 Mon Sep 17 00:00:00 2001 From: David Rabkin Date: Thu, 14 Dec 2023 22:48:12 +0200 Subject: [PATCH] copyright, scanner, ydata: improve readability, use cya --- app/copyright | 15 ++++++--------- app/scanner | 7 +++++-- app/ydata | 7 +++---- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/copyright b/app/copyright index 7a09bc6..ae40a82 100755 --- a/app/copyright +++ b/app/copyright @@ -1,6 +1,6 @@ #!/bin/sh # vi:et lbr noet sw=2 ts=2 tw=79 wrap -# Copyright 2022-2023 David Rabkin +# Copyright 2022-2023-2023 David Rabkin # The script uses local variables which are not POSIX but supported by most # shells, see: # https://stackoverflow.com/q/18597697 @@ -18,8 +18,8 @@ BASE_APP_USAGE="$( } readonly \ BASE_APP_USAGE \ - BASE_APP_VERSION=0.9.20231203 \ - BASE_MIN_VERSION=0.9.20231111 + BASE_APP_VERSION=0.9.20231214 \ + BASE_MIN_VERSION=0.9.20231212 . base.sh # Analyzes input files, fixes copyright years if needed. @@ -66,12 +66,9 @@ main() { xargs 2>&1 )" || { local err=$? - if [ "$fil" = "" ]; then - logw Unable to continue, err=$err. - printf '%s is not found.\n' "$PATTERN" - exit 0 - fi - die Unable to continue, err=$err, msg="$fil". + [ "$fil" = "" ] || die Unable to continue, err=$err, msg="$fil". + printf '%s is not found.\n' "$PATTERN" + cya Unable to continue, err=$err. } # shellcheck disable=SC2086 # No need for double quates. diff --git a/app/scanner b/app/scanner index 7f30bcc..1367f4c 100755 --- a/app/scanner +++ b/app/scanner @@ -2,7 +2,10 @@ # vi:et lbr noet sw=2 ts=2 tw=79 wrap # Copyright 2020-2023 David Rabkin # Detects if a device with a certain MAC address is in the local network. -# shellcheck disable=SC1091 # File not following. +# shellcheck disable=SC1091,SC2034 # File not following, variable unused. +readonly \ + BASE_APP_VERSION=0.9.20231214 \ + BASE_MIN_VERSION=0.9.20231212 . base.sh MAXV=10 MINV=1 @@ -55,7 +58,7 @@ validate_cmd arp-scan [ "$#" -eq 1 ] || die "Usage: $BASE_IAM [MAC-ADDRESS:list]" [ "$1" = list ] && { $SCAN - exit 0 + cya } is_mac "$1" MACA="$1" diff --git a/app/ydata b/app/ydata index 8bd47fa..cf374f6 100755 --- a/app/ydata +++ b/app/ydata @@ -17,8 +17,8 @@ export \ # shellcheck disable=SC2034 # Variable appears unused. readonly \ - BASE_APP_VERSION=0.9.20231126 \ - BASE_MIN_VERSION=0.9.20230315 + BASE_APP_VERSION=0.9.20231214 \ + BASE_MIN_VERSION=0.9.20231212 # shellcheck disable=SC1091 # File not following. . base.sh @@ -114,8 +114,7 @@ download() { isempty "$VID" || return 0 # Stops if there are no downloaded files. - log There is no new downloaded video. - exit 0 + cya There is no new downloaded video. } # Moves result to local archive.