Skip to content

Commit

Permalink
Adopt less logging on basic operations
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavid committed Jan 4, 2024
1 parent 3ec550b commit f0a251f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/install
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/sh
# vi:et lbr noet sw=2 ts=2 tw=79 wrap
# Copyright 2022-2023 David Rabkin
# Copyright 2022-2024 David Rabkin
# Uses Unix shell framework shellbase:
# https://github.com/rdavid/shellbase/
# The script uses local variables which are not POSIX but supported by most
# shells. See:
# https://stackoverflow.com/q/18597697
# shellcheck disable=SC3043,SC2034 # Uses local variables, appears unused.
readonly \
BASE_APP_VERSION=0.9.20231216 \
BASE_MIN_VERSION=0.9.20230505 \
BASE_APP_VERSION=0.9.20240105 \
BASE_MIN_VERSION=0.9.20240104 \
DST=/usr/local/bin \
REL=0.9.20231212 \
TGT=/usr/local/bin/base.sh
Expand All @@ -35,7 +35,7 @@ main() {
new="shellbase $REL" \
old
validate "$@"
if file_exists $TGT >/dev/null 2>&1; then
if file_exists $TGT; then
old="$(sh $TGT --quiet --version 2>&1)" || die "$old"
[ "$old" = "$new" ] &&
msg="$new is already installed in $DST. Continue anyway?" ||
Expand Down
8 changes: 4 additions & 4 deletions app/tru
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
# vi:et lbr noet sw=2 ts=2 tw=79 wrap
# Copyright 2020-2023 David Rabkin
# Copyright 2020-2024 David Rabkin
# tru stands for Transmission Remote Updater. The script removes a torrent with
# content and than adds it again. It is useful to automatically increase a
# ratio.
Expand All @@ -10,8 +10,8 @@
# shellcheck disable=SC3043 # Uses local variables.
# shellcheck disable=SC1091,SC2034 # File not following, appears unused.
readonly \
BASE_APP_VERSION=0.9.20231216 \
BASE_MIN_VERSION=0.9.20230312
BASE_APP_VERSION=0.9.20240105 \
BASE_MIN_VERSION=0.9.20240104
. base.sh

# Looks for torrent ID by torrent name extracted from torrent file name.
Expand Down Expand Up @@ -84,7 +84,7 @@ validation() {
nc -z $prm >/dev/null 2>&1 || die "$prm" is not available.

# Validates third parameter full torrent file name.
isreadable "$TOR" || die
isreadable "$TOR" || die Unable to read "$TOR".
out="$(transmission-show "$TOR")" || die Unable to read "$TOR": "$out"
NME="$(printf %s "$out" | grep Name: | head -1 | cut -c 7-)"
readonly NME
Expand Down

0 comments on commit f0a251f

Please sign in to comment.