From c01cf386608cbef77c53d6b2bf3c2f6d2b2be91d Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 4 Oct 2018 23:10:42 +0200 Subject: [PATCH] Fix SC2164 --- cdist/conf/explorer/disks | 2 +- cdist/conf/type/__link/explorer/state | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cdist/conf/explorer/disks b/cdist/conf/explorer/disks index 7a5c0da0..7c60b17a 100755 --- a/cdist/conf/explorer/disks +++ b/cdist/conf/explorer/disks @@ -1,3 +1,3 @@ #!/bin/sh -cd /dev +cd /dev || exit 0 echo sd? hd? vd? diff --git a/cdist/conf/type/__link/explorer/state b/cdist/conf/type/__link/explorer/state index b8d8fc2b..587835a2 100755 --- a/cdist/conf/type/__link/explorer/state +++ b/cdist/conf/type/__link/explorer/state @@ -32,7 +32,7 @@ destination_dir="${destination%/*}" case "$type" in symbolic) - cd "$destination_dir" + cd "$destination_dir" || exit 1 source_is=$(ls -l "$destination" | sed 's/.*-> //g') if [ -h "$destination" ]; then # ignore trailing slashes for comparison @@ -46,7 +46,7 @@ case "$type" in fi ;; hard) - cd "$destination_dir" + cd "$destination_dir" || exit 1 # check source relative to destination_dir if [ ! -e "$source" ]; then echo sourcemissing