diff options
author | Martin Schwenke <martin@meltin.net> | 2016-06-29 17:36:05 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2016-07-06 04:28:09 +0200 |
commit | f227c26178c2eaf3fae49f32a90ec905f85005f4 (patch) | |
tree | f03ba950aceb801a7cad29fa6957c98868673454 /ctdb/config/statd-callout | |
parent | 850863a15ef462b4df53d5bdad3c80dbaf569089 (diff) | |
download | samba-f227c26178c2eaf3fae49f32a90ec905f85005f4.tar.gz |
ctdb-scripts: Update script boilerplate to avoid shellcheck warnings
* Assign the output of dirname to temporary variable to avoid word
splitting when directory name contains whitespace
* Drop export of CTDB_BASE to avoid masking broken return value -
functions file does the export anyway
* Quote path when including functions file
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/config/statd-callout')
-rwxr-xr-x | ctdb/config/statd-callout | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ctdb/config/statd-callout b/ctdb/config/statd-callout index 1cbe6532f98..4e8ae9a1e88 100755 --- a/ctdb/config/statd-callout +++ b/ctdb/config/statd-callout @@ -9,9 +9,9 @@ # STATD_HOSTNAME="myhostname -H /etc/ctdb/statd-callout" [ -n "$CTDB_BASE" ] || \ - export CTDB_BASE=$(cd -P $(dirname "$0") ; echo "$PWD") + CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD") -. $CTDB_BASE/functions +. "${CTDB_BASE}/functions" # Overwrite this so we get some logging die () |