diff --git a/handlers/restic.in b/handlers/restic.in
index 664547cd3e990c839b94d127b85497453e4682e9..28cf099ba6ab945685c8fcfafd65487e0caedd88 100644
--- a/handlers/restic.in
+++ b/handlers/restic.in
@@ -230,6 +230,8 @@ else
   fi
 fi
 
+[ -n "$test" ] || test=0
+
 ### INIT #######################################################################
 
 if [ "$need_init" = "yes" ]; then