From 97aea8ddf2a783ff21094f0e497d3678adb38f61 Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Wed, 1 Jun 2022 17:46:57 +0200 Subject: [PATCH] sync.sh: some shellcheck fixes --- bash/sync-conf-example.sh | 10 +++++----- bash/sync.sh | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bash/sync-conf-example.sh b/bash/sync-conf-example.sh index 340ca2f..8e7487b 100644 --- a/bash/sync-conf-example.sh +++ b/bash/sync-conf-example.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # sync-conf-example.sh - a "sync.sh" configuration file example. # @@ -22,9 +22,9 @@ # SOURCEDIR="" # SERVER="" # DESTDIR="" -SOURCEDIR=/example-srcdir -SERVER=root@backuphost -DESTDIR=/mnt/nas1/example-destdir +export SOURCEDIR=/example-srcdir +export SERVER=root@backuphost +export DESTDIR=/mnt/nas1/example-destdir ###### backups to keep # NYEARS=3 @@ -96,7 +96,7 @@ aftersync() { log -s -t "calling user aftersync" } -# For Emacs, shell-mode: +# For Emacs, shell-script-mode: # Local Variables: # mode: shell-script # End: diff --git a/bash/sync.sh b/bash/sync.sh index f6cf85a..8e72df1 100755 --- a/bash/sync.sh +++ b/bash/sync.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # sync.sh - a backup utility using ssh/rsync facilities. # @@ -480,7 +480,7 @@ parse_opts() { printf "%s: Cannot open $CONFIG file. Exiting.\n" "$CMDNAME" exit 9 fi - # shellcheck source=/dev/null + # shellcheck source=sync-conf-example.sh source "$CONFIG" LOCKDIR="/tmp/$CMDNAME-$HOSTNAME-${CONFIG##*/}.lock"