1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yunomonitor_ynh.git synced 2024-09-03 17:46:11 +02:00

Fix python code

This commit is contained in:
Salamandar 2024-01-19 16:44:13 +01:00
parent 2fca6c3e68
commit 6fea0a454f

View file

@ -68,11 +68,12 @@ ynh_script_progression --message="Adding a configuration file..."
python3 -c ' python3 -c '
import sys import sys
import yaml import yaml
print(yaml.dumps({ split_or_empty = lambda x: [] if x == "" else x.split(",")
"mails": sys.argv[1].split(","), print(yaml.dump({
"sms_apis": sys.argv[2].split(","), "mails": split_or_empty(sys.argv[1]),
"monitored_servers": sys.argv[3].split(","), "sms_apis": split_or_empty(sys.argv[2]),
"monitoring_servers": sys.argv[4].split(","), "monitored_servers": split_or_empty(sys.argv[3]),
"monitoring_servers": split_or_empty(sys.argv[4]),
})) }))
' "$mails" "$sms_api" "$monitored_servers" "$monitoring_servers" \ ' "$mails" "$sms_api" "$monitored_servers" "$monitoring_servers" \
> "$install_dir/conf/$app.yml" > "$install_dir/conf/$app.yml"