]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/paks/mysql/update.sh
mysql: Fix updating the package.
[people/teissler/ipfire-2.x.git] / src / paks / mysql / update.sh
index 89c40d0d7c5d3dd57b5944f3af4977d5f8d76760..548b9dbd3b50244d0a112450d75d33639e757634 100644 (file)
 ############################################################################
 #
 . /opt/pakfire/lib/functions.sh
-./uninstall.sh
-./install.sh
+
+# Create backup include file if it is missing.
+if [ ! -e "/var/ipfire/backup/addons/includes/mysql" ]; then
+       cat <<EOF > /var/ipfire/backup/addons/includes/mysql
+/etc/my.cnf
+/srv/mysql
+EOF
+fi
+
+# Stop the mysql service
+stop_service "${NAME}"
+
+# Make backup
+make_backup "${NAME}"
+
+# Update files
+remove_files
+extract_files
+
+# Restore backup
+restore_backup "${NAME}"
+
+# Restart the service
+start_service "${NAME}"
+
+exit 0