mirror of
https://github.com/YunoHost-Apps/scrutiny_ynh.git
synced 2024-09-03 20:16:24 +02:00
Merge cae74e1380
into 252d6a0250
This commit is contained in:
commit
61cd94e777
18 changed files with 241 additions and 178 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
*~
|
*~
|
||||||
*.sw[op]
|
*.sw[op]
|
||||||
|
.DS_Store
|
||||||
|
|
|
@ -5,4 +5,6 @@
|
||||||
- [Irakurri README euskaraz](README_eu.md)
|
- [Irakurri README euskaraz](README_eu.md)
|
||||||
- [Lire le README en français](README_fr.md)
|
- [Lire le README en français](README_fr.md)
|
||||||
- [Le o README en galego](README_gl.md)
|
- [Le o README en galego](README_gl.md)
|
||||||
|
- [Baca README dalam bahasa bahasa Indonesia](README_id.md)
|
||||||
|
- [Прочитать README на русский](README_ru.md)
|
||||||
- [阅读中文(简体)的 README](README_zh_Hans.md)
|
- [阅读中文(简体)的 README](README_zh_Hans.md)
|
||||||
|
|
|
@ -5,7 +5,7 @@ It shall NOT be edited by hand.
|
||||||
|
|
||||||
# Scrutiny for YunoHost
|
# Scrutiny for YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/scrutiny)  
|
[](https://ci-apps.yunohost.org/ci/apps/scrutiny/)  
|
||||||
|
|
||||||
[](https://install-app.yunohost.org/?app=scrutiny)
|
[](https://install-app.yunohost.org/?app=scrutiny)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ No se debe editar a mano.
|
||||||
|
|
||||||
# Scrutiny para Yunohost
|
# Scrutiny para Yunohost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/scrutiny)  
|
[](https://ci-apps.yunohost.org/ci/apps/scrutiny/)  
|
||||||
|
|
||||||
[](https://install-app.yunohost.org/?app=scrutiny)
|
[](https://install-app.yunohost.org/?app=scrutiny)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ EZ editatu eskuz.
|
||||||
|
|
||||||
# Scrutiny YunoHost-erako
|
# Scrutiny YunoHost-erako
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/scrutiny)  
|
[](https://ci-apps.yunohost.org/ci/apps/scrutiny/)  
|
||||||
|
|
||||||
[](https://install-app.yunohost.org/?app=scrutiny)
|
[](https://install-app.yunohost.org/?app=scrutiny)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main.
|
||||||
|
|
||||||
# Scrutiny pour YunoHost
|
# Scrutiny pour YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/scrutiny)  
|
[](https://ci-apps.yunohost.org/ci/apps/scrutiny/)  
|
||||||
|
|
||||||
[](https://install-app.yunohost.org/?app=scrutiny)
|
[](https://install-app.yunohost.org/?app=scrutiny)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ NON debe editarse manualmente.
|
||||||
|
|
||||||
# Scrutiny para YunoHost
|
# Scrutiny para YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/scrutiny)  
|
[](https://ci-apps.yunohost.org/ci/apps/scrutiny/)  
|
||||||
|
|
||||||
[](https://install-app.yunohost.org/?app=scrutiny)
|
[](https://install-app.yunohost.org/?app=scrutiny)
|
||||||
|
|
||||||
|
|
63
README_id.md
Normal file
63
README_id.md
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
<!--
|
||||||
|
N.B.: README ini dibuat secara otomatis oleh <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||||
|
Ini TIDAK boleh diedit dengan tangan.
|
||||||
|
-->
|
||||||
|
|
||||||
|
# Scrutiny untuk YunoHost
|
||||||
|
|
||||||
|
[](https://ci-apps.yunohost.org/ci/apps/scrutiny/)  
|
||||||
|
|
||||||
|
[](https://install-app.yunohost.org/?app=scrutiny)
|
||||||
|
|
||||||
|
*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)*
|
||||||
|
|
||||||
|
> *Paket ini memperbolehkan Anda untuk memasang Scrutiny secara cepat dan mudah pada server YunoHost.*
|
||||||
|
> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.*
|
||||||
|
|
||||||
|
## Ringkasan
|
||||||
|
|
||||||
|
**Scrutiny is a Hard Drive Health Dashboard & Monitoring solution, merging manufacturer provided S.M.A.R.T metrics with real-world failure rates.**
|
||||||
|
|
||||||
|
> NOTE: Scrutiny is a Work-in-Progress and still has some rough edges.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
Scrutiny is a simple but focused application, with a couple of core features:
|
||||||
|
|
||||||
|
- Web UI Dashboard - focused on Critical metrics
|
||||||
|
- `smartd` integration (no re-inventing the wheel)
|
||||||
|
- Auto-detection of all connected hard-drives
|
||||||
|
- S.M.A.R.T metric tracking for historical trends
|
||||||
|
- Customized thresholds using real world failure rates
|
||||||
|
- Temperature tracking
|
||||||
|
- Provided as an all-in-one Docker image (but can be installed manually)
|
||||||
|
- Configurable Alerting/Notifications via Webhooks
|
||||||
|
- (Future) Hard Drive performance testing & tracking
|
||||||
|
|
||||||
|
|
||||||
|
**Versi terkirim:** 0.8.1~ynh1
|
||||||
|
|
||||||
|
## Tangkapan Layar
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Dokumentasi dan sumber daya
|
||||||
|
|
||||||
|
- Dokumentasi admin resmi: <https://github.com/AnalogJ/scrutiny/tree/master/docs>
|
||||||
|
- Depot kode aplikasi hulu: <https://github.com/AnalogJ/scrutiny>
|
||||||
|
- Gudang YunoHost: <https://apps.yunohost.org/app/scrutiny>
|
||||||
|
- Laporkan bug: <https://github.com/YunoHost-Apps/scrutiny_ynh/issues>
|
||||||
|
|
||||||
|
## Info developer
|
||||||
|
|
||||||
|
Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/scrutiny_ynh/tree/testing).
|
||||||
|
|
||||||
|
Untuk mencoba branch `testing`, silakan dilanjutkan seperti:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo yunohost app install https://github.com/YunoHost-Apps/scrutiny_ynh/tree/testing --debug
|
||||||
|
atau
|
||||||
|
sudo yunohost app upgrade scrutiny -u https://github.com/YunoHost-Apps/scrutiny_ynh/tree/testing --debug
|
||||||
|
```
|
||||||
|
|
||||||
|
**Info lebih lanjut mengenai pemaketan aplikasi:** <https://yunohost.org/packaging_apps>
|
63
README_ru.md
Normal file
63
README_ru.md
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
<!--
|
||||||
|
Важно: этот README был автоматически сгенерирован <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||||
|
Он НЕ ДОЛЖЕН редактироваться вручную.
|
||||||
|
-->
|
||||||
|
|
||||||
|
# Scrutiny для YunoHost
|
||||||
|
|
||||||
|
[](https://ci-apps.yunohost.org/ci/apps/scrutiny/)  
|
||||||
|
|
||||||
|
[](https://install-app.yunohost.org/?app=scrutiny)
|
||||||
|
|
||||||
|
*[Прочтите этот README на других языках.](./ALL_README.md)*
|
||||||
|
|
||||||
|
> *Этот пакет позволяет Вам установить Scrutiny быстро и просто на YunoHost-сервер.*
|
||||||
|
> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.*
|
||||||
|
|
||||||
|
## Обзор
|
||||||
|
|
||||||
|
**Scrutiny is a Hard Drive Health Dashboard & Monitoring solution, merging manufacturer provided S.M.A.R.T metrics with real-world failure rates.**
|
||||||
|
|
||||||
|
> NOTE: Scrutiny is a Work-in-Progress and still has some rough edges.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
Scrutiny is a simple but focused application, with a couple of core features:
|
||||||
|
|
||||||
|
- Web UI Dashboard - focused on Critical metrics
|
||||||
|
- `smartd` integration (no re-inventing the wheel)
|
||||||
|
- Auto-detection of all connected hard-drives
|
||||||
|
- S.M.A.R.T metric tracking for historical trends
|
||||||
|
- Customized thresholds using real world failure rates
|
||||||
|
- Temperature tracking
|
||||||
|
- Provided as an all-in-one Docker image (but can be installed manually)
|
||||||
|
- Configurable Alerting/Notifications via Webhooks
|
||||||
|
- (Future) Hard Drive performance testing & tracking
|
||||||
|
|
||||||
|
|
||||||
|
**Поставляемая версия:** 0.8.1~ynh1
|
||||||
|
|
||||||
|
## Снимки экрана
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Документация и ресурсы
|
||||||
|
|
||||||
|
- Официальная документация администратора: <https://github.com/AnalogJ/scrutiny/tree/master/docs>
|
||||||
|
- Репозиторий кода главной ветки приложения: <https://github.com/AnalogJ/scrutiny>
|
||||||
|
- Магазин YunoHost: <https://apps.yunohost.org/app/scrutiny>
|
||||||
|
- Сообщите об ошибке: <https://github.com/YunoHost-Apps/scrutiny_ynh/issues>
|
||||||
|
|
||||||
|
## Информация для разработчиков
|
||||||
|
|
||||||
|
Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/scrutiny_ynh/tree/testing).
|
||||||
|
|
||||||
|
Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo yunohost app install https://github.com/YunoHost-Apps/scrutiny_ynh/tree/testing --debug
|
||||||
|
или
|
||||||
|
sudo yunohost app upgrade scrutiny -u https://github.com/YunoHost-Apps/scrutiny_ynh/tree/testing --debug
|
||||||
|
```
|
||||||
|
|
||||||
|
**Больше информации о пакетировании приложений:** <https://yunohost.org/packaging_apps>
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
# YunoHost 上的 Scrutiny
|
# YunoHost 上的 Scrutiny
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/scrutiny)  
|
[](https://ci-apps.yunohost.org/ci/apps/scrutiny/)  
|
||||||
|
|
||||||
[](https://install-app.yunohost.org/?app=scrutiny)
|
[](https://install-app.yunohost.org/?app=scrutiny)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@ code = "https://github.com/AnalogJ/scrutiny"
|
||||||
fund = "https://paypal.me/analogj/usd10"
|
fund = "https://paypal.me/analogj/usd10"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.2"
|
yunohost = ">= 11.2.18"
|
||||||
|
helpers_version = "2.1"
|
||||||
architectures = ["amd64", "arm64"]
|
architectures = ["amd64", "arm64"]
|
||||||
multi_instance = false
|
multi_instance = false
|
||||||
ldap = "not_relevant"
|
ldap = "not_relevant"
|
||||||
|
@ -41,7 +42,7 @@ ram.runtime = "50M"
|
||||||
[resources]
|
[resources]
|
||||||
[resources.sources]
|
[resources.sources]
|
||||||
|
|
||||||
[resources.sources.main]
|
[resources.sources.scrutiny-web-linux]
|
||||||
in_subdir = false
|
in_subdir = false
|
||||||
rename = "scrutiny-web-linux"
|
rename = "scrutiny-web-linux"
|
||||||
amd64.url = "https://github.com/AnalogJ/scrutiny/releases/download/v0.8.1/scrutiny-web-linux-amd64"
|
amd64.url = "https://github.com/AnalogJ/scrutiny/releases/download/v0.8.1/scrutiny-web-linux-amd64"
|
||||||
|
@ -55,6 +56,7 @@ ram.runtime = "50M"
|
||||||
|
|
||||||
[resources.sources.scrutiny-collector-metrics-linux]
|
[resources.sources.scrutiny-collector-metrics-linux]
|
||||||
in_subdir = false
|
in_subdir = false
|
||||||
|
rename = "scrutiny-collector-metrics-linux"
|
||||||
amd64.url = "https://github.com/AnalogJ/scrutiny/releases/download/v0.8.1/scrutiny-collector-metrics-linux-amd64"
|
amd64.url = "https://github.com/AnalogJ/scrutiny/releases/download/v0.8.1/scrutiny-collector-metrics-linux-amd64"
|
||||||
amd64.sha256 = "904056ddc4e0bd3455a0db45d56f98084135a967eef018d18bfc8e4c0ef6887e"
|
amd64.sha256 = "904056ddc4e0bd3455a0db45d56f98084135a967eef018d18bfc8e4c0ef6887e"
|
||||||
arm64.url = "https://github.com/AnalogJ/scrutiny/releases/download/v0.8.1/scrutiny-collector-metrics-linux-arm64"
|
arm64.url = "https://github.com/AnalogJ/scrutiny/releases/download/v0.8.1/scrutiny-collector-metrics-linux-arm64"
|
||||||
|
@ -75,9 +77,6 @@ ram.runtime = "50M"
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
|
||||||
[resources.install_dir]
|
[resources.install_dir]
|
||||||
dir = "/var/www/__APP__"
|
|
||||||
owner = "__APP__:rwx"
|
|
||||||
group = "__APP__:rx"
|
|
||||||
|
|
||||||
[resources.permissions]
|
[resources.permissions]
|
||||||
main.url = "/"
|
main.url = "/"
|
||||||
|
|
|
@ -1,25 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# COMMON VARIABLES
|
# COMMON VARIABLES AND CUSTOM HELPERS
|
||||||
#=================================================
|
|
||||||
ynh_arch="$YNH_ARCH"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# PERSONAL HELPERS
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
myynh_set_permissions () {
|
myynh_set_permissions () {
|
||||||
chown -R $app: "$install_dir"
|
chown -R $app: "$install_dir"
|
||||||
chmod 750 "$install_dir"
|
chmod 750 "$install_dir"
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chmod -R +x "$install_dir/bin/"
|
chmod -R +x "$install_dir/bin/"
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# EXPERIMENTAL HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# FUTURE OFFICIAL HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
|
@ -1,30 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
ynh_print_info "Declaring files to be backed up..."
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info --message="Declaring files to be backed up..."
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="$install_dir"
|
ynh_backup "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
|
@ -32,19 +23,19 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
# BACKUP LOGROTATE
|
# BACKUP LOGROTATE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/logrotate.d/$app"
|
ynh_backup "/etc/logrotate.d/$app"
|
||||||
ynh_backup --src_path="/var/log/$app"
|
ynh_backup "/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP SYSTEMD
|
# BACKUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/scrutiny-web-server.service"
|
ynh_backup "/etc/systemd/system/scrutiny-web-server.service"
|
||||||
ynh_backup --src_path="/etc/systemd/system/scrutiny-collector.service"
|
ynh_backup "/etc/systemd/system/scrutiny-collector.service"
|
||||||
ynh_backup --src_path="/etc/systemd/system/scrutiny-collector.timer"
|
ynh_backup "/etc/systemd/system/scrutiny-collector.timer"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||||
|
|
|
@ -1,34 +1,26 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC STARTING
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD MODIFICATIONS
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
# STOP SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
ynh_script_progression "Stopping $app's systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name="influxdb" --action="stop"
|
ynh_systemctl --service="influxdb" --action="stop"
|
||||||
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="stop" --log_path="/var/log/$app/web-server.log"
|
ynh_systemctl --service="scrutiny-web-server.service" --action="stop" --log_path="/var/log/$app/web-server.log"
|
||||||
if [ $collector -eq 1 ]
|
if [ $collector -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="stop" --log_path="/var/log/$app/collector.log"
|
ynh_systemctl --service="scrutiny-collector.timer" --action="stop" --log_path="/var/log/$app/collector.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
ynh_script_progression "Updating NGINX web server configuration..."
|
||||||
|
|
||||||
ynh_change_url_nginx_config
|
ynh_config_change_url_nginx
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC MODIFICATIONS
|
# SPECIFIC MODIFICATIONS
|
||||||
|
@ -48,34 +40,32 @@ then
|
||||||
key="basepath"
|
key="basepath"
|
||||||
new_value="'$new_base_path'"
|
new_value="'$new_base_path'"
|
||||||
sed --regexp-extended "s/^(\s*${key}:\s*).*/\1${new_value}/" --in-place "$install_dir/config/scrutiny.yaml"
|
sed --regexp-extended "s/^(\s*${key}:\s*).*/\1${new_value}/" --in-place "$install_dir/config/scrutiny.yaml"
|
||||||
ynh_store_file_checksum --file="$install_dir/config/scrutiny.yaml"
|
ynh_store_file_checksum "$install_dir/config/scrutiny.yaml"
|
||||||
|
|
||||||
# Update collector.yaml
|
# Update collector.yaml
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --key=port)
|
||||||
key="endpoint"
|
key="endpoint"
|
||||||
new_value="'http:\/\/127.0.0.1:${port}${new_base_path}\/'"
|
new_value="'http:\/\/127.0.0.1:${port}${new_base_path}\/'"
|
||||||
sed --regexp-extended "s/^(\s*${key}:\s*).*/\1${new_value}/" --in-place "$install_dir/config/collector.yaml"
|
sed --regexp-extended "s/^(\s*${key}:\s*).*/\1${new_value}/" --in-place "$install_dir/config/collector.yaml"
|
||||||
ynh_store_file_checksum --file="$install_dir/config/collector.yaml"
|
ynh_store_file_checksum "$install_dir/config/collector.yaml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALISATION
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression "Starting $app's systemd service..."
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
ynh_systemd_action --service_name="influxdb" --action="start"
|
ynh_systemctl --service="influxdb" --action="start"
|
||||||
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log"
|
ynh_systemctl --service="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log"
|
||||||
if [ $collector -eq 1 ]
|
if [ $collector -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
|
ynh_systemctl --service="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
ynh_script_progression "Change of URL completed for $app"
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -14,10 +8,10 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
ynh_script_progression "Setting up source files..."
|
||||||
|
|
||||||
mkdir -p "$install_dir/bin"
|
mkdir -p "$install_dir/bin"
|
||||||
ynh_setup_source --source_id="main" --dest_dir="$install_dir/bin"
|
ynh_setup_source --source_id="scrutiny-web-linux" --dest_dir="$install_dir/bin"
|
||||||
ynh_setup_source --source_id="scrutiny-collector-metrics-linux" --dest_dir="$install_dir/bin"
|
ynh_setup_source --source_id="scrutiny-collector-metrics-linux" --dest_dir="$install_dir/bin"
|
||||||
|
|
||||||
mkdir -p "$install_dir/web"
|
mkdir -p "$install_dir/web"
|
||||||
|
@ -26,30 +20,30 @@ ynh_setup_source --source_id="scrutiny-web-frontend" --dest_dir="$install_dir/we
|
||||||
#=================================================
|
#=================================================
|
||||||
# SYSTEM CONFIGURATION
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding system configurations related to $app ..." --weight=1
|
ynh_script_progression "Adding system configurations related to $app ..."
|
||||||
|
|
||||||
# Create a dedicated NGINX config using the conf/nginx.conf template
|
# Create a dedicated NGINX config using the conf/nginx.conf template
|
||||||
ynh_add_nginx_config
|
ynh_config_add_nginx
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config --service="scrutiny-web-server" --template="systemd-scrutiny-web-server.service"
|
ynh_config_add_systemd --service="scrutiny-web-server" --template="systemd-scrutiny-web-server.service"
|
||||||
yunohost service add "scrutiny-web-server" --description="WebUI for smartd S.M.A.R.T monitoring" --log="/var/log/$app/web-server.log" --test_status="systemctl show scrutiny-web-server.service -p ActiveState --value | grep -v failed"
|
yunohost service add "scrutiny-web-server" --description="WebUI for smartd S.M.A.R.T monitoring" --log="/var/log/$app/web-server.log" --test_status="systemctl show scrutiny-web-server.service -p ActiveState --value | grep -v failed"
|
||||||
|
|
||||||
ynh_add_config --template="systemd-scrutiny-collector.service" --destination="/etc/systemd/system/scrutiny-collector.service"
|
ynh_config_add --template="systemd-scrutiny-collector.service" --destination="/etc/systemd/system/scrutiny-collector.service"
|
||||||
if [ $collector -eq 1 ]
|
if [ $collector -eq 1 ]
|
||||||
then
|
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"
|
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
|
fi
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate --specific_user="$app"
|
ynh_config_add_logrotate
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# APP INITIAL CONFIGURATION
|
# APP INITIAL CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
ynh_script_progression "Adding $app's configuration..."
|
||||||
|
|
||||||
mkdir -p "$install_dir/config"
|
mkdir -p "$install_dir/config"
|
||||||
if [ "${path}" == "/" ]
|
if [ "${path}" == "/" ]
|
||||||
|
@ -58,10 +52,10 @@ then
|
||||||
else
|
else
|
||||||
base_path="${path}"
|
base_path="${path}"
|
||||||
fi
|
fi
|
||||||
ynh_add_config --template="config/scrutiny.yaml" --destination="$install_dir/config/scrutiny.yaml"
|
ynh_config_add --template="config/scrutiny.yaml" --destination="$install_dir/config/scrutiny.yaml"
|
||||||
|
|
||||||
ynh_add_config --template="systemd-scrutiny-collector.timer" --destination="/etc/systemd/system/scrutiny-collector.timer"
|
ynh_config_add --template="systemd-scrutiny-collector.timer" --destination="/etc/systemd/system/scrutiny-collector.timer"
|
||||||
ynh_add_config --template="config/collector.yaml" --destination="$install_dir/config/collector.yaml"
|
ynh_config_add --template="config/collector.yaml" --destination="$install_dir/config/collector.yaml"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SET FILE OWNERSHIP / PERMISSIONS
|
# SET FILE OWNERSHIP / PERMISSIONS
|
||||||
|
@ -69,26 +63,24 @@ ynh_add_config --template="config/collector.yaml" --destination="$install_dir/co
|
||||||
|
|
||||||
myynh_set_permissions
|
myynh_set_permissions
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression "Starting $app's systemd service..."
|
||||||
ynh_systemd_action --service_name="influxdb" --action="enable"
|
ynh_systemctl --service="influxdb" --action="enable"
|
||||||
ynh_systemd_action --service_name="influxdb" --action="start"
|
ynh_systemctl --service="influxdb" --action="start"
|
||||||
|
|
||||||
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="enable"
|
ynh_systemctl --service="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_systemctl --service="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.timer" --action="enable"
|
ynh_systemctl --service="scrutiny-collector.timer" --action="enable"
|
||||||
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
|
ynh_systemctl --service="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installation of $app completed" --last
|
ynh_script_progression "Installation of $app completed"
|
||||||
|
|
|
@ -1,44 +1,39 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE SYSTEM CONFIGURATIONS
|
# REMOVE SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE SYSTEMD SERVICE
|
# REMOVE SYSTEMD SERVICE
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
ynh_script_progression "Removing system configurations related to $app..."
|
||||||
|
|
||||||
if ynh_exec_warn_less yunohost service status "scrutiny-web-server" >/dev/null
|
if ynh_hide_warnings yunohost service status "scrutiny-web-server" >/dev/null
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Removing scrutiny-web-server service integration..." --weight=1
|
ynh_script_progression "Removing scrutiny-web-server service integration..."
|
||||||
yunohost service remove "scrutiny-web-server"
|
yunohost service remove "scrutiny-web-server"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ynh_exec_warn_less yunohost service status "scrutiny-collector" >/dev/null
|
if ynh_hide_warnings yunohost service status "scrutiny-collector" >/dev/null
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Removing scrutiny-collector service integration..." --weight=1
|
ynh_script_progression "Removing scrutiny-collector service integration..."
|
||||||
yunohost service remove "scrutiny-collector"
|
yunohost service remove "scrutiny-collector"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_remove_systemd_config --service="scrutiny-web-server"
|
ynh_config_remove_systemd"scrutiny-web-server"
|
||||||
ynh_remove_systemd_config --service="scrutiny-collector"
|
ynh_config_remove_systemd"scrutiny-collector"
|
||||||
ynh_secure_remove --file="/etc/systemd/system/scrutiny-collector.timer"
|
ynh_safe_rm "/etc/systemd/system/scrutiny-collector.timer"
|
||||||
|
|
||||||
ynh_remove_nginx_config
|
ynh_config_remove_nginx
|
||||||
|
|
||||||
ynh_remove_logrotate
|
ynh_config_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Removal of $app completed" --last
|
ynh_script_progression "Removal of $app completed"
|
||||||
|
|
|
@ -1,63 +1,55 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
ynh_script_progression "Restoring the app main directory..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$install_dir"
|
ynh_restore "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEM CONFIGURATIONS
|
# RESTORE SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
ynh_script_progression "Restoring system configurations related to $app..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-web-server.service"
|
ynh_restore "/etc/systemd/system/scrutiny-web-server.service"
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-collector.service"
|
ynh_restore "/etc/systemd/system/scrutiny-collector.service"
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/scrutiny-collector.timer"
|
ynh_restore "/etc/systemd/system/scrutiny-collector.timer"
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
ynh_restore "/etc/logrotate.d/$app"
|
||||||
ynh_restore_file --origin_path="/var/log/$app"
|
ynh_restore "/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
|
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
|
ynh_script_progression "Reloading NGINX web server and $app's service..."
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
ynh_systemd_action --service_name="nginx" --action="reload"
|
ynh_systemctl --service="nginx" --action="reload"
|
||||||
|
|
||||||
ynh_systemd_action --service_name="influxdb" --action="enable"
|
ynh_systemctl --service="influxdb" --action="enable"
|
||||||
ynh_systemd_action --service_name="influxdb" --action="start"
|
ynh_systemctl --service="influxdb" --action="start"
|
||||||
|
|
||||||
systemctl enable "/etc/systemd/system/scrutiny-web-server.service" --quiet
|
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" --test_status="systemctl show scrutiny-web-server.service -p ActiveState --value | grep -v failed"
|
yunohost service add "scrutiny-web-server" --description="WebUI for smartd S.M.A.R.T monitoring" --log="/var/log/$app/web-server.log" --test_status="systemctl show scrutiny-web-server.service -p ActiveState --value | grep -v failed"
|
||||||
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log"
|
ynh_systemctl --service="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log"
|
||||||
|
|
||||||
if [ $collector -eq 1 ]
|
if [ $collector -eq 1 ]
|
||||||
then
|
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"
|
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.timer" --action="enable"
|
ynh_systemctl --service="scrutiny-collector.timer" --action="enable"
|
||||||
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
|
ynh_systemctl --service="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Restoration completed for $app" --last
|
ynh_script_progression "Restoration completed for $app"
|
||||||
|
|
|
@ -1,35 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD UPGRADE STEPS
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
#ynh_script_progression "Ensuring downward compatibility..."
|
||||||
ynh_secure_remove --file="$install_dir/bin/scrutiny-web-linux-$YNH_ARCH"
|
|
||||||
ynh_secure_remove --file="$install_dir/bin/scrutiny-collector-metrics-linux-$YNH_ARCH"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
# STOP SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
ynh_script_progression "Stopping $app's systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name="influxdb" --action="stop"
|
ynh_systemctl --service="influxdb" --action="stop"
|
||||||
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="stop" --log_path="/var/log/$app/web-server.log"
|
ynh_systemctl --service="scrutiny-web-server.service" --action="stop" --log_path="/var/log/$app/web-server.log"
|
||||||
if [ $collector -eq 1 ]
|
if [ $collector -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="stop" --log_path="/var/log/$app/collector.log"
|
ynh_systemctl --service="scrutiny-collector.timer" --action="stop" --log_path="/var/log/$app/collector.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -38,37 +26,37 @@ fi
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
ynh_script_progression "Upgrading source files..."
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --source_id="main" --dest_dir="$install_dir/bin"
|
ynh_setup_source --source_id="scrutiny-web-linux" --dest_dir="$install_dir/bin"
|
||||||
ynh_setup_source --source_id="scrutiny-collector-metrics-linux" --dest_dir="$install_dir/bin"
|
ynh_setup_source --source_id="scrutiny-collector-metrics-linux" --dest_dir="$install_dir/bin"
|
||||||
ynh_setup_source --source_id="scrutiny-web-frontend" --dest_dir="$install_dir/web"
|
ynh_setup_source --source_id="scrutiny-web-frontend" --dest_dir="$install_dir/web"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REAPPLY SYSTEM CONFIGURATIONS
|
# REAPPLY SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
ynh_script_progression "Upgrading system configurations related to $app..."
|
||||||
|
|
||||||
ynh_add_nginx_config
|
ynh_config_add_nginx
|
||||||
|
|
||||||
ynh_add_systemd_config --service="scrutiny-web-server" --template="systemd-scrutiny-web-server.service"
|
ynh_config_add_systemd --service="scrutiny-web-server" --template="systemd-scrutiny-web-server.service"
|
||||||
yunohost service add "scrutiny-web-server" --description="WebUI for smartd S.M.A.R.T monitoring" --log="/var/log/$app/web-server.log" --test_status="systemctl show scrutiny-web-server.service -p ActiveState --value | grep -v failed"
|
yunohost service add "scrutiny-web-server" --description="WebUI for smartd S.M.A.R.T monitoring" --log="/var/log/$app/web-server.log" --test_status="systemctl show scrutiny-web-server.service -p ActiveState --value | grep -v failed"
|
||||||
|
|
||||||
ynh_add_config --template="systemd-scrutiny-collector.service" --destination="/etc/systemd/system/scrutiny-collector.service"
|
ynh_config_add --template="systemd-scrutiny-collector.service" --destination="/etc/systemd/system/scrutiny-collector.service"
|
||||||
if [ $collector -eq 1 ]
|
if [ $collector -eq 1 ]
|
||||||
then
|
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"
|
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
|
fi
|
||||||
|
|
||||||
ynh_use_logrotate --specific_user="$app" --non-append
|
ynh_config_add_logrotate
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS, ...)
|
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS, ...)
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
ynh_script_progression "Updating configuration..."
|
||||||
|
|
||||||
if [ "${path}" == "/" ]
|
if [ "${path}" == "/" ]
|
||||||
then
|
then
|
||||||
|
@ -76,10 +64,10 @@ then
|
||||||
else
|
else
|
||||||
base_path="${path}"
|
base_path="${path}"
|
||||||
fi
|
fi
|
||||||
ynh_add_config --template="config/scrutiny.yaml" --destination="$install_dir/config/scrutiny.yaml"
|
ynh_config_add --template="config/scrutiny.yaml" --destination="$install_dir/config/scrutiny.yaml"
|
||||||
|
|
||||||
ynh_add_config --template="systemd-scrutiny-collector.timer" --destination="/etc/systemd/system/scrutiny-collector.timer"
|
ynh_config_add --template="systemd-scrutiny-collector.timer" --destination="/etc/systemd/system/scrutiny-collector.timer"
|
||||||
ynh_add_config --template="config/collector.yaml" --destination="$install_dir/config/collector.yaml"
|
ynh_config_add --template="config/collector.yaml" --destination="$install_dir/config/collector.yaml"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SET FILE OWNERSHIP / PERMISSIONS
|
# SET FILE OWNERSHIP / PERMISSIONS
|
||||||
|
@ -90,23 +78,23 @@ myynh_set_permissions
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression "Starting $app's systemd service..."
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
ynh_systemd_action --service_name="influxdb" --action="enable"
|
ynh_systemctl --service="influxdb" --action="enable"
|
||||||
ynh_systemd_action --service_name="influxdb" --action="start"
|
ynh_systemctl --service="influxdb" --action="start"
|
||||||
|
|
||||||
ynh_systemd_action --service_name="scrutiny-web-server.service" --action="enable"
|
ynh_systemctl --service="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_systemctl --service="scrutiny-web-server.service" --action="start" --log_path="/var/log/$app/web-server.log"
|
||||||
if [ $collector -eq 1 ]
|
if [ $collector -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="enable"
|
ynh_systemctl --service="scrutiny-collector.timer" --action="enable"
|
||||||
ynh_systemd_action --service_name="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
|
ynh_systemctl --service="scrutiny-collector.timer" --action="start" --log_path="/var/log/$app/collector.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
ynh_script_progression "Upgrade of $app completed"
|
||||||
|
|
Loading…
Add table
Reference in a new issue