diff options
author | Heinz Wiesinger <pprkut@liwjatan.at> | 2010-10-20 01:54:52 -0500 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2010-10-20 10:50:24 -0500 |
commit | 3d74e7552a27d6bc6cfa1a2d83de6ec4e9516643 (patch) | |
tree | 65fa4a36c82140128c4dacea96913efc3ad4bdc9 /system/mariadb/doinst.sh | |
parent | 3d06bf97f2d59f94b04c26c73d38a34ccfa7626c (diff) | |
download | slackbuilds-3d74e7552a27d6bc6cfa1a2d83de6ec4e9516643.tar.gz |
system/mariadb: Added (Drop-in replacement for MySQL)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/mariadb/doinst.sh')
-rw-r--r-- | system/mariadb/doinst.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/system/mariadb/doinst.sh b/system/mariadb/doinst.sh new file mode 100644 index 0000000000..30509fa0d9 --- /dev/null +++ b/system/mariadb/doinst.sh @@ -0,0 +1,26 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.mysqld.new + |