mirror of
https://github.com/YunoHost-Apps/monitorix_ynh.git
synced 2024-09-03 19:46:06 +02:00
Fix some bugs
This commit is contained in:
parent
088620b046
commit
f8722ce5b8
5 changed files with 13 additions and 6 deletions
|
@ -24,7 +24,7 @@
|
||||||
"install" : [
|
"install" : [
|
||||||
{
|
{
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain",
|
"type": "domain",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose a domain name for Monitorix",
|
"en": "Choose a domain name for Monitorix",
|
||||||
"fr": "Choisissez un nom de domaine pour Monitorix"
|
"fr": "Choisissez un nom de domaine pour Monitorix"
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "path",
|
"name": "path",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose a path for Monitorix",
|
"en": "Choose a path for Monitorix",
|
||||||
"fr": "Choisissez un chemin pour Monitorix"
|
"fr": "Choisissez un chemin pour Monitorix"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
## Adapt md5sum while you update app
|
## Adapt md5sum while you update app
|
||||||
md5sum="7314ad6fcd014a34c2e4e8a95455bcaa"
|
md5sum="7314ad6fcd014a34c2e4e8a95455bcaa"
|
||||||
|
monitorix_version="3.9.0"
|
||||||
|
|
||||||
init_script() {
|
init_script() {
|
||||||
# Exit on command errors and treat unset variables as an error
|
# Exit on command errors and treat unset variables as an error
|
||||||
|
@ -16,7 +17,7 @@ init_script() {
|
||||||
|
|
||||||
get_source() {
|
get_source() {
|
||||||
|
|
||||||
wget -q -O '/tmp/monitorix.deb' 'http://www.monitorix.org/monitorix_3.9.0-izzy1_all.deb'
|
wget -q -O '/tmp/monitorix.deb' "http://www.monitorix.org/monitorix_${monitorix_version}-izzy1_all.deb"
|
||||||
|
|
||||||
if [[ ! -e '/tmp/monitorix.deb' ]] || [[ $(md5sum '/tmp/monitorix.deb' | cut -d' ' -f1) != $md5sum ]]
|
if [[ ! -e '/tmp/monitorix.deb' ]] || [[ $(md5sum '/tmp/monitorix.deb' | cut -d' ' -f1) != $md5sum ]]
|
||||||
then
|
then
|
||||||
|
|
|
@ -36,3 +36,7 @@ ynh_backup "/etc/nginx/conf.d/monitorix_status.conf" "monitorix_status.conf"
|
||||||
|
|
||||||
# Copy Monitorix configuration
|
# Copy Monitorix configuration
|
||||||
ynh_backup "/etc/monitorix" "config"
|
ynh_backup "/etc/monitorix" "config"
|
||||||
|
|
||||||
|
# Copy Monitorix data
|
||||||
|
ynh_backup "/var/lib/monitorix" "data"
|
||||||
|
|
||||||
|
|
|
@ -35,10 +35,10 @@ ynh_app_setting_set "$app" mysqlpwd "$dbpass"
|
||||||
ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass"
|
ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass"
|
||||||
|
|
||||||
# Find a port for built-in monitorix HTTP server
|
# Find a port for built-in monitorix HTTP server
|
||||||
FIND_PORT 8080
|
NO_LOG FIND_PORT 8080
|
||||||
http_port=$port
|
http_port=$port
|
||||||
ynh_app_setting_set $app http_port $http_port
|
ynh_app_setting_set $app http_port $http_port
|
||||||
FIND_PORT $(($port +1))
|
NO_LOG FIND_PORT $(($port +1))
|
||||||
nginx_status_port=$port
|
nginx_status_port=$port
|
||||||
ynh_app_setting_set $app nginx_status_port $nginx_status_port
|
ynh_app_setting_set $app nginx_status_port $nginx_status_port
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ get_source
|
||||||
ynh_package_update
|
ynh_package_update
|
||||||
ynh_package_install rrdtool perl libwww-perl libmailtools-perl libmime-lite-perl librrds-perl libdbi-perl libxml-simple-perl libhttp-server-simple-perl libconfig-general-perl
|
ynh_package_install rrdtool perl libwww-perl libmailtools-perl libmime-lite-perl librrds-perl libdbi-perl libxml-simple-perl libhttp-server-simple-perl libconfig-general-perl
|
||||||
sudo dpkg -i /tmp/monitorix.deb
|
sudo dpkg -i /tmp/monitorix.deb
|
||||||
|
sudo rm -rf /etc/monitorix/conf.d/00-debian.conf
|
||||||
ynh_package_install -f
|
ynh_package_install -f
|
||||||
|
|
||||||
# # Create and restore the database
|
# # Create and restore the database
|
||||||
|
@ -79,7 +80,8 @@ sudo cp -a ./nginx.conf "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
||||||
sudo cp -a ./monitorix_status.conf "/etc/nginx/conf.d/monitorix_status.conf"
|
sudo cp -a ./monitorix_status.conf "/etc/nginx/conf.d/monitorix_status.conf"
|
||||||
|
|
||||||
# Restore Monitorix configuration
|
# Restore Monitorix configuration
|
||||||
sudo cp -a ./config "/etc/monitorix"
|
sudo cp -a ./config/. "/etc/monitorix/."
|
||||||
|
sudo cp -a ./data/. "/var/lib/monitorix/."
|
||||||
|
|
||||||
|
|
||||||
# Restart webserver
|
# Restart webserver
|
||||||
|
|
Loading…
Add table
Reference in a new issue