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:
parent
a2155e224b
commit
ae0b7048e9
3 changed files with 38 additions and 28 deletions
|
@ -34,9 +34,6 @@ configure_netdata() {
|
||||||
|
|
||||||
# Restart NetData
|
# Restart NetData
|
||||||
systemctl 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
|
# Add a web_log entry for every YunoHost domain
|
||||||
|
|
|
@ -93,6 +93,9 @@ ynh_add_nginx_config
|
||||||
pushd $NETDATA_TMPDIR
|
pushd $NETDATA_TMPDIR
|
||||||
./netdata-installer.sh --install /opt --dont-wait
|
./netdata-installer.sh --install /opt --dont-wait
|
||||||
|
|
||||||
|
# Store the uninstaller for the removal script
|
||||||
|
mv ./netdata-uninstaller.sh /opt/netdata/etc/netdata
|
||||||
|
|
||||||
configure_netdata
|
configure_netdata
|
||||||
|
|
||||||
# Store the app.src file
|
# Store the app.src file
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC START
|
||||||
|
@ -65,6 +65,10 @@ ynh_add_nginx_config
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
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
|
# 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"
|
./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
|
configure_netdata
|
||||||
|
|
||||||
# Store the app.src file
|
# Store the app.src file
|
||||||
popd
|
|
||||||
cp ../conf/app.src /opt/netdata/etc/netdata
|
cp ../conf/app.src /opt/netdata/etc/netdata
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue