1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/scrutiny_ynh.git synced 2024-09-03 20:16:24 +02:00
This commit is contained in:
ewilly 2023-04-03 09:08:54 +02:00
parent 3c98eca468
commit b3e165a453
5 changed files with 19 additions and 20 deletions

View file

@ -66,10 +66,10 @@ log:
level: INFO level: INFO
api: api:
# endpoint: 'https://__DOMAIN____PATH__/'
endpoint: 'http://127.0.0.1:__PORT____PATH__/' endpoint: 'http://127.0.0.1:__PORT____PATH__/'
# if you need to use a custom base path (for a reverse proxy), you can add a suffix to the endpoint. # if you need to use a custom base path (for a reverse proxy), you can add a suffix to the endpoint.
# See docs/TROUBLESHOOTING_REVERSE_PROXY.md for more info, # See docs/TROUBLESHOOTING_REVERSE_PROXY.md for more info,
# endpoint: 'https://__DOMAIN____PATH__/'
# example to show how to override the smartctl command args globally # example to show how to override the smartctl command args globally
#commands: #commands:

View file

@ -4,7 +4,7 @@ id = "scrutiny"
name = "Scrutiny" name = "Scrutiny"
description.en = "WebUI for smartd S.M.A.R.T monitoring" description.en = "WebUI for smartd S.M.A.R.T monitoring"
version = "0.6.0~ynh2" version = "0.6.0~ynh3"
maintainers = ["ewilly"] maintainers = ["ewilly"]

View file

@ -83,12 +83,13 @@ myynh_set_permissions
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name="influxdb" --action="enable" ynh_systemd_action --service_name="influxdb" --action="enable"
ynh_systemd_action --service_name="influxdb" --action="start" ynh_systemd_action --service_name="influxdb" --action="start"
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="enable"
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log" ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log"
if [ $collector -eq 1 ] if [ $collector -eq 1 ]
then then
systemctl daemon-reload systemctl daemon-reload
ynh_systemd_action --service_name="scrutiny-collector.service" --action="enable"
ynh_systemd_action --service_name="scrutiny-collector.service" --action="start" --log_path="/var/log/$app/collector.log"
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable"
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
fi fi

View file

@ -26,16 +26,9 @@ ynh_script_progression --message="Restoring system configurations related to $ap
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-web-server.service" ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-web-server.service"
systemctl enable "/etc/systemd/system/scrutiny-web-server.service" --quiet
ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-collector.service" ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-collector.service"
ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-collector.timer" ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-collector.timer"
yunohost service add "scrutiny-web-server" --description="WebUI for smartd S.M.A.R.T monitoring" --log="/var/log/$app/web-server.log"
if [ $collector -eq 1 ]
then
yunohost service add "scrutiny-collector" --description="Collector running on timer (daily) for smartd S.M.A.R.T monitoring" --log="/var/log/$app/collector.log" --test_status="systemctl show scrutiny-collector.service -p ActiveState --value | grep -v failed"
fi
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
ynh_restore_file --origin_path="/var/log/$app" ynh_restore_file --origin_path="/var/log/$app"
@ -46,20 +39,23 @@ ynh_restore_file --origin_path="/var/log/$app"
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
# Typically you only have either $app or php-fpm but not both at the same time... systemctl daemon-reload
ynh_systemd_action --service_name="nginx" --action="reload"
ynh_systemd_action --service_name="influxdb" --action="enable"
ynh_systemd_action --service_name="influxdb" --action="start" ynh_systemd_action --service_name="influxdb" --action="start"
systemctl enable "/etc/systemd/system/scrutiny-web-server.service" --quiet
yunohost service add "scrutiny-web-server" --description="WebUI for smartd S.M.A.R.T monitoring" --log="/var/log/$app/web-server.log"
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log" ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log"
if [ $collector -eq 1 ] if [ $collector -eq 1 ]
then then
systemctl daemon-reload yunohost service add "scrutiny-collector" --description="Collector running on timer (daily) for smartd S.M.A.R.T monitoring" --log="/var/log/$app/collector.log" --test_status="systemctl show scrutiny-collector.service -p ActiveState --value | grep -v failed"
ynh_systemd_action --service_name="scrutiny-collector.service" --action="enable"
ynh_systemd_action --service_name="scrutiny-collector.service" --action="start" --log_path="/var/log/$app/collector.log"
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable"
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
fi fi
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -100,14 +100,16 @@ myynh_set_permissions
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
systemctl daemon-reload
ynh_systemd_action --service_name="influxdb" --action="enable" ynh_systemd_action --service_name="influxdb" --action="enable"
ynh_systemd_action --service_name="influxdb" --action="start" ynh_systemd_action --service_name="influxdb" --action="start"
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="enable"
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log" ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log"
if [ $collector -eq 1 ] if [ $collector -eq 1 ]
then then
systemctl daemon-reload
ynh_systemd_action --service_name="scrutiny-collector.service" --action="enable"
ynh_systemd_action --service_name="scrutiny-collector.service" --action="start" --log_path="/var/log/$app/collector.log"
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable"
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log" ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
fi fi