SC2039: In POSIX sh, -nt is not supported.
This script is specific to the Linux NFS implementation. The -nt
operator is well supported in Linux shells (e.g. dash, bash, ksh).
The alternatives (e.g. using stat(1)) would result in less readable
code.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
nfs_monitor_list_shares ()
{
_cache_file="${CTDB_NFS_CALLOUT_STATE_DIR}/list_shares_cache"
+ # -nt operator is well supported in Linux: dash, bash, ksh, ...
+ # shellcheck disable=SC2039
if [ ! -r "$nfs_exports_file" ] || [ ! -r "$_cache_file" ] || \
[ "$nfs_exports_file" -nt "$_cache_file" ] ; then
mkdir -p "$CTDB_NFS_CALLOUT_STATE_DIR"