sync.sh: Minor changes
This commit is contained in:
@@ -162,10 +162,10 @@ function aftersync () {
|
|||||||
# Some variables were moved into the code (example: in the log() function),
|
# Some variables were moved into the code (example: in the log() function),
|
||||||
# for practical reasons, the absence of associative arrays being one of them.
|
# for practical reasons, the absence of associative arrays being one of them.
|
||||||
LOCKED=n # indicates if we created lock file.
|
LOCKED=n # indicates if we created lock file.
|
||||||
SUBJECT="${0##*/} ${*##*/}" # mail subject (removes paths)
|
CMDNAME=${0##*/} # script name
|
||||||
|
SUBJECT="$CMDNAME ${*##*/}" # mail subject
|
||||||
ERROR=0 # set by error_handler when called
|
ERROR=0 # set by error_handler when called
|
||||||
STARTTIME=$(date +%s) # time since epoch in seconds
|
STARTTIME=$(date +%s) # time since epoch in seconds
|
||||||
CMDNAME=${0##*/}
|
|
||||||
|
|
||||||
usage () {
|
usage () {
|
||||||
printf "usage: %s [-ymwdnfrzuDZ] config-file\n" "$CMDNAME"
|
printf "usage: %s [-ymwdnfrzuDZ] config-file\n" "$CMDNAME"
|
||||||
@@ -196,8 +196,8 @@ done
|
|||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
(( $# != 1 )) && usage
|
(( $# != 1 )) && usage
|
||||||
CONFIG="$1"
|
CONFIG="$1"
|
||||||
if [[ ! -f "$CONFIG" ]]; then
|
if [[ ! -r "$CONFIG" ]]; then
|
||||||
echo "No $CONFIG file."
|
printf "%s: Canot open $CONFIG file. Exiting."
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user