diff --git a/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh b/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh index f53f88e..31a78ba 100755 --- a/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh +++ b/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh @@ -226,9 +226,10 @@ function find_harddisk() done fi ) if [ -z "$dev" ] ; then - echo "no valid harddisk for initialisation found!" >>"$LOG_FILE" + log_msg "no valid harddisk for initialisation found!" cat /proc/partitions >>"$LOG_FILE" - return 1 + # do not return with an error, to avoid a failing of the script ('break on error') + # the caller of this function should handle an empty return string fi echo -n "$dev" } diff --git a/scripts/cbox-dev.sh b/scripts/cbox-dev.sh index 6547fd4..3ebbdf7 100755 --- a/scripts/cbox-dev.sh +++ b/scripts/cbox-dev.sh @@ -116,7 +116,7 @@ function box_diff() [ $# -eq 0 ] && echo "[`basename $0`] - no arguments supplied - maybe you want to use '--help'" && exit 1 ACTION=--help -[ $# -gt 1 ] && $ACTION=$1 +[ $# -gt 1 ] && ACTION=$1 case "$1" in diff ) @@ -160,7 +160,7 @@ case "$1" in echo -e "unknown action: $1" echo $0 help - exit "1" + exit 1 ;; esac