Permalink
Please sign in to comment.
Browse files
preinst/postinst fixes to work along with existing commit #11f842510a…
…1473f50cb9eb955a92a0a69e45ace8 This handles the normal update-cases seamlessly, avoiding needless prompting the user!
- Loading branch information...
Showing
with
32 additions
and 0 deletions.
| @@ -0,0 +1,22 @@ | ||
| +#!/bin/sh -e | ||
| +MYSQLCONFIG="/etc/mysql/conf.d/mythtv.cnf" | ||
| +MYSQLCONFIGUPDATEHINT="/etc/mysql/conf.d/mythtv.cnf.ipv6update-with-public_bind.tmp" | ||
| + | ||
| +#This script (in combination with postinst amendment) purely to handle update-cases | ||
| +# from old installations with public_bind enabled so they seamlessly update without | ||
| +# generating needless "configuration modified by user" prompts. | ||
| + | ||
| +case "$1" in | ||
| + upgrade) | ||
| + if [ -f "${MYSQLCONFIG}" ]; then | ||
| + if grep ^bind-address=0.0.0.0$ ${MYSQLCONFIG} > /dev/null; then | ||
| + sed -i -e 's/^bind-address=0.0.0.0$/#bind-address=0.0.0.0/' ${MYSQLCONFIG} | ||
| + echo "#" > ${MYSQLCONFIGUPDATEHINT} | ||
| + fi | ||
| + #in the case that public-binding was enabled, restore the original default-config, leaving | ||
| + # a hint to the postinst which fixes this up upon postinst configure. | ||
| + #only users who actually modified /etc/mysql/conf.d/mythtv.cnf manually will get prompted. | ||
| + fi | ||
| +esac | ||
| + | ||
| +exit 0 |
0 comments on commit
02aa3a4