From 48cf3a560169bf7bb96c1e9b8ce8da7b9d11052d Mon Sep 17 00:00:00 2001 From: sudolulo Date: Mon, 15 Jun 2026 02:37:04 +0000 Subject: [PATCH] recover.sh: verify middlewared started cleanly before claiming success --- recover.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/recover.sh b/recover.sh index e62623e..b810a8a 100755 --- a/recover.sh +++ b/recover.sh @@ -30,10 +30,18 @@ fi touch "$PATCH_DIR/disabled" echo "Kill switch set: $PATCH_DIR/disabled created." echo "Restarting middlewared ..." -systemctl restart middlewared -echo "" -echo "middlewared restarted without the truecloud-patch hook." -echo "Your system should be back to normal (Storj-only TrueCloud Backup)." +if systemctl restart middlewared; then + echo "" + echo "middlewared started successfully." + echo "Your system is back to normal (Storj-only TrueCloud Backup)." +else + echo "" + echo "WARNING: middlewared did not start cleanly even with the patch disabled." + echo "The problem is unrelated to truecloud-patch." + echo "Check the system log for details:" + echo " journalctl -u middlewared -n 50" + exit 1 +fi echo "" echo "To re-enable the patch once you have investigated:" echo " rm $PATCH_DIR/disabled"