1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monitorix_ynh.git synced 2024-09-03 19:46:06 +02:00

Many small fix

This commit is contained in:
Josué Tille 2024-09-01 23:44:30 +02:00
parent 38169d35fa
commit 90934700a4
No known key found for this signature in database
GPG key ID: 5F259226AD51F2F5
8 changed files with 12 additions and 13 deletions

View file

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
bash __INSTALL_DIR__/update_config_if_needed.sh bash __INSTALL_DIR__/update_config_if_needed.sh install

View file

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
bash __INSTALL_DIR__/update_config_if_needed.sh bash __INSTALL_DIR__/update_config_if_needed.sh remove

View file

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
bash __INSTALL_DIR__/update_config_if_needed.sh bash __INSTALL_DIR__/update_config_if_needed.sh upgrade

View file

@ -80,7 +80,7 @@ load_vars() {
readonly net_gateway="$(ip --json route show default | jq -r '.[0].dev')" readonly net_gateway="$(ip --json route show default | jq -r '.[0].dev')"
readonly net_interface_list="$(ip --json link show | jq -r '.[].ifname | select(. != "lo")' | interface_speed_map)" readonly net_interface_list="$(ip --json link show | jq -r '.[].ifname | select(. != "lo")' | interface_speed_map)"
readonly net_max_speed="$(cat /sys/class/net/*/speed 2>/dev/null | sort | tail -n1 | sed 's|-1|1000|g')" readonly net_max_speed="$(cat /sys/class/net/*/speed 2>/dev/null | sort | tail -n1 | sed 's|-1|1000|g')"
readonly ssh_port="$((grep ssh_port /etc/yunohost/settings.yml || echo 22) | cut -d: -f2 | xargs)" readonly ssh_port="$((([ -e /etc/yunohost/settings.yml ] && grep ssh_port /etc/yunohost/settings.yml) || echo 22) | cut -d: -f2 | xargs)"
readonly port_infos="$(python3 <<EOF readonly port_infos="$(python3 <<EOF
import yaml, socket import yaml, socket
hard_coded_ports = ["25", "53", "80", "443", "587", "993"] hard_coded_ports = ["25", "53", "80", "443", "587", "993"]
@ -134,7 +134,7 @@ with open("/etc/yunohost/services.yml", "r") as f:
EOF EOF
)" )"
if compgen -G /etc/php/*/fpm/pool.d; then if compgen -G /etc/php/*/fpm/pool.d/*; then
# Note that 'pm.status_listen' option is only supported on php >= 8.0 so we ignore older pools # Note that 'pm.status_listen' option is only supported on php >= 8.0 so we ignore older pools
readonly php_pools_infos="$(grep -E '^\[.*\]' \ readonly php_pools_infos="$(grep -E '^\[.*\]' \
--exclude=/etc/php/*/fpm/pool.d/"$app"_status.conf \ --exclude=/etc/php/*/fpm/pool.d/"$app"_status.conf \

View file

@ -1,7 +1,6 @@
#!/bin/bash #!/bin/bash
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source ../settings/scripts/experimental_helper.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
load_vars load_vars

View file

@ -41,12 +41,12 @@ for pool_dir_by_version in /etc/php/*; do
fi fi
done done
if ynh_psql_user_exists --user="$db_user"; then if $mysql_installed && ynh_mysql_user_exists --user="$db_user"; then
ynh_psql_drop_user "$db_user"
fi
if ynh_mysql_user_exists --user="$db_user"; then
ynh_mysql_drop_user "$db_user" ynh_mysql_drop_user "$db_user"
fi fi
if $postgresql_installed && ynh_psql_user_exists --user="$db_user"; then
ynh_psql_drop_user "$db_user"
fi
_ynh_apt autoremove --purge monitorix _ynh_apt autoremove --purge monitorix
ynh_safe_rm "$install_dir" ynh_safe_rm "$install_dir"

View file

@ -1,7 +1,6 @@
#!/bin/bash #!/bin/bash
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source ../settings/scripts/experimental_helper.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
load_vars load_vars

View file

@ -5,6 +5,7 @@ set -eu
app=__APP__ app=__APP__
YNH_APP_BASEDIR=/etc/yunohost/apps/"$app" YNH_APP_BASEDIR=/etc/yunohost/apps/"$app"
YNH_HELPERS_VERSION=2.1 YNH_HELPERS_VERSION=2.1
YNH_APP_ACTION="$1"
pushd /etc/yunohost/apps/$app/conf pushd /etc/yunohost/apps/$app/conf
source ../scripts/_common.sh source ../scripts/_common.sh
@ -80,7 +81,7 @@ if "$status_dirty"; then
if "$phpfpm_installed"; then if "$phpfpm_installed"; then
config_php_fpm config_php_fpm
fi fi
ynh_systemctl --service_name="$app" --action=restart --log_path='systemd' --line_match=' - Ok, ready.' ynh_systemctl --service="$app" --action=restart --log_path=systemd --wait_until=' - Ok, ready.'
ynh_systemctl --service_name=nginx --action=reload ynh_systemctl --service=nginx --action=reload
save_vars_current_value save_vars_current_value
fi fi