summaryrefslogtreecommitdiff
path: root/audio/TiMidity++/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'audio/TiMidity++/doinst.sh')
-rw-r--r--audio/TiMidity++/doinst.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/audio/TiMidity++/doinst.sh b/audio/TiMidity++/doinst.sh
index 359c5a3f8b..56700cc0ff 100644
--- a/audio/TiMidity++/doinst.sh
+++ b/audio/TiMidity++/doinst.sh
@@ -4,12 +4,24 @@ config() {
# 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
+ 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
+}
+
config etc/timidity.cfg.new
-config etc/rc.d/rc.timidity.new
+preserve_perms etc/rc.d/rc.timidity.new