From 53d1e2e23652bed84d82f5697c45fe69ae977354 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 16 Dec 2021 11:49:03 +0100 Subject: [PATCH] Improve upgrade with ">>" flows file --- scripts/upgrade | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 2d8d4f7..5ccbcdb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -87,9 +87,14 @@ fi # Flows were stored in file named after the hostname. # Not very portable. Let's fix that. -if [ ! -f "$final_path/data/flows.json" ]; then +if [[ ! -f "$final_path/data/flows.json" && -f "$final_path/data/flows_$(hostname).json" ]]; then mv "$final_path/data/flows_$(hostname)_cred.json" "$final_path/data/flows_cred.json" mv "$final_path/data/flows_$(hostname).json" "$final_path/data/flows.json" +# Flows could be stored in a file named '>>'. +# Definitely weird, let's fix that. +elif [[ ! -f "$final_path/data/flows.json" && -f "$final_path/data/>>" ]]; then + mv "$final_path/data/>>_cred" "$final_path/data/flows_cred.json" + mv "$final_path/data/>>" "$final_path/data/flows.json" fi #=================================================