diff options
author | Heinz Wiesinger <pprkut@liwjatan.at> | 2010-12-06 22:44:51 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-12-06 23:26:21 -0600 |
commit | 2ea80394f84a1897169ad75f6ec81ca6a3f003aa (patch) | |
tree | a3465fd9b22b979e0e5d9571c950b1e7829d13d7 /network/mediatomb/doinst.sh | |
parent | 4ecfc6bfd15c8e3eefdb0d19ada8d190a17f1646 (diff) |
network/mediatomb: Added (an open source UPnP MediaServer)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/mediatomb/doinst.sh')
-rw-r--r-- | network/mediatomb/doinst.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/network/mediatomb/doinst.sh b/network/mediatomb/doinst.sh new file mode 100644 index 0000000000..adc456f74f --- /dev/null +++ b/network/mediatomb/doinst.sh @@ -0,0 +1,29 @@ +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 +} + +# Prepare the new configuration files +config etc/mediatomb/config.xml.new +config etc/rc.d/rc.mediatomb.conf.new +preserve_perms etc/rc.d/rc.mediatomb.new + |