1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yunorunner_ynh.git synced 2024-09-03 20:36:13 +02:00

Fix upgrade from old version

This commit is contained in:
Salamandar 2024-03-15 14:34:01 +01:00
parent ea04b4c63c
commit 0456e52e21

View file

@ -44,6 +44,24 @@ if yunohost firewall list | grep -q "\- $port$"; then
ynh_exec_warn_less yunohost firewall disallow TCP "$port"
fi
if [[ -z "$context" ]]; then
if grep -q "CI_APP" /etc/hosts; then
context=official_infra
else
context=personal_ci
fi
ynh_app_setting_set --app="$app" --key="context" --value="$context"
fi
if [[ -z "$cluster" ]]; then
if incus cluster list >/dev/null 2>&1; then
cluster=1
else
cluster=0
fi
ynh_app_setting_set --app="$app" --key="cluster" --value="$cluster"
fi
# Values now use underscore
if echo "$context" | grep -- -; then
context=$(echo "$context" | tr - _)