21
21
# # @postinst DEBIAN/postinst
22
22
# # This script is used to execute post installation tasks.
23
23
# #
24
- # # Author: Ivan Zoratti
24
+ # # Author: Ivan Zoratti, Massimiliano Pinto
25
25
# #
26
26
# #--------------------------------------------------------------------
27
27
@@ -74,6 +74,24 @@ install_pip3_packages () {
74
74
pip3 install -r /usr/local/foglamp/python/requirements.txt
75
75
}
76
76
77
+ # Call FogLAMP package update script
78
+ # Any message will be written by called update script
79
+ call_package_update_script () {
80
+ # File created by presinstall hook
81
+ installed_version_file=" /usr/local/foglamp/.current_installed_version"
82
+ if [ -s " ${installed_version_file} " ]; then
83
+ current_installed_version=` cat ${installed_version_file} `
84
+ update_script=" /usr/local/foglamp/scripts/package/debian/package_update.sh"
85
+ # Check update script exists
86
+ if [ -x " ${update_script} " ] && [ -s " ${update_script} " ] && [ -O " ${update_script} " ]; then
87
+ # Call Debian update script passing the previous version
88
+ ${update_script} ${current_installed_version}
89
+ fi
90
+ # Update done: remove temp file
91
+ rm ${installed_version_file}
92
+ fi
93
+ }
94
+
77
95
# main
78
96
echo " Install python dependencies"
79
97
install_pip3_packages
@@ -85,6 +103,10 @@ echo "Generating certificate files"
85
103
generate_certs
86
104
echo " Setting ownership of FogLAMP files"
87
105
set_files_ownership
106
+
107
+ # Call FogLAMP package update script
108
+ call_package_update_script
109
+
88
110
echo " Enabling FogLAMP service"
89
111
enable_foglamp_service
90
112
echo " Starting FogLAMP service"
0 commit comments