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

Don't re-install netdata itself if upstream version unchanged

This commit is contained in:
Jimmy Monin 2017-12-27 10:45:39 +01:00
parent a2155e224b
commit ae0b7048e9
3 changed files with 38 additions and 28 deletions

View file

@ -34,9 +34,6 @@ configure_netdata() {
# Restart NetData
systemctl restart netdata
# Store the uninstaller for the removal script
[ -f ./netdata-uninstaller.sh ] && mv ./netdata-uninstaller.sh /opt/netdata/etc/netdata
}
# Add a web_log entry for every YunoHost domain

View file

@ -93,6 +93,9 @@ ynh_add_nginx_config
pushd $NETDATA_TMPDIR
./netdata-installer.sh --install /opt --dont-wait
# Store the uninstaller for the removal script
mv ./netdata-uninstaller.sh /opt/netdata/etc/netdata
configure_netdata
# Store the app.src file

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
#=================================================
# GENERIC START
@ -65,6 +65,10 @@ ynh_add_nginx_config
ynh_install_app_dependencies $pkg_dependencies
installed_version=$(cat /opt/netdata/etc/netdata/app.src | grep SOURCE_URL | sed "s|.*/v\(.*\)/.*|\1|g")
version_to_install=$(cat ../conf/app.src | grep SOURCE_URL | sed "s|.*/v\(.*\)/.*|\1|g")
if [ "$installed_version" != "$version_to_install" ] ; then
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -94,10 +98,16 @@ rm -f /etc/systemd/system/netdata.service
./netdata-installer.sh --install /opt --dont-wait >&3 2>&3 || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
# Store the uninstaller for the removal script
mv ./netdata-uninstaller.sh /opt/netdata/etc/netdata
popd
fi
# Specific configuration
configure_netdata
# Store the app.src file
popd
cp ../conf/app.src /opt/netdata/etc/netdata
#=================================================