mirror of
https://github.com/YunoHost-Apps/nodered_ynh.git
synced 2024-09-03 19:46:25 +02:00
Improve upgrade with ">>" flows file
This commit is contained in:
parent
48ac205c8b
commit
53d1e2e236
1 changed files with 6 additions and 1 deletions
|
@ -87,9 +87,14 @@ fi
|
||||||
|
|
||||||
# Flows were stored in file named after the hostname.
|
# Flows were stored in file named after the hostname.
|
||||||
# Not very portable. Let's fix that.
|
# 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)_cred.json" "$final_path/data/flows_cred.json"
|
||||||
mv "$final_path/data/flows_$(hostname).json" "$final_path/data/flows.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
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue