From 4b23888a13a8d6f84c4fea819a24f304ed0d1d27 Mon Sep 17 00:00:00 2001 From: "thorsten.spille" Date: Tue, 21 Nov 2023 22:20:54 +0100 Subject: [PATCH] Add returncode --- bashclub-zsync/usr/bin/bashclub-zsync | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bashclub-zsync/usr/bin/bashclub-zsync b/bashclub-zsync/usr/bin/bashclub-zsync index 4ab96c8..64be7e2 100644 --- a/bashclub-zsync/usr/bin/bashclub-zsync +++ b/bashclub-zsync/usr/bin/bashclub-zsync @@ -16,6 +16,7 @@ wc=$(which wc) tr=$(which tr) sed=$(which sed) zfs_auto_snapshot=$(which zfs-auto-snapshot) +rc=0 debug= #### default config file, can be changed with parameter -c @@ -213,6 +214,7 @@ for name in "${syncvols[@]}"; do done else log "[ERROR] No snapshot found on $target/$name to add incremental snapshots to. The target dataset (with all children) needs to be deleted and recreated via replication." + if [ $rc -eq 0 ]; then rc=1; fi fi if [[ $debug == "-v" ]]; then log "[DEBUG] $name - Start deletion of old snapshots"; fi @@ -241,3 +243,4 @@ for name in "${syncvols[@]}"; do if [[ $debug == "-v" ]]; then log "[DEBUG] $name - No snapshots found with filter $snapshot_filter"; fi fi done +exit $rc \ No newline at end of file