diff options
author | Luís Fernando Carvalho Cavalheiro <pessoal@profcavalheiro.com> | 2016-12-01 01:07:53 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-12-03 07:17:45 +0700 |
commit | d566692c1fa3d36128ac17fe6d55dfff23b35081 (patch) | |
tree | ed225a41a3a41109ca8decf38e6a2d3d2758bd84 /multimedia/serviio/doinst.sh | |
parent | 52e67c59ce6e3e20be7d3163e30111783ae815da (diff) | |
download | slackbuilds-d566692c1fa3d36128ac17fe6d55dfff23b35081.tar.gz |
multimedia/serviio: Added (Java-based DNLA media server).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'multimedia/serviio/doinst.sh')
-rw-r--r-- | multimedia/serviio/doinst.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/multimedia/serviio/doinst.sh b/multimedia/serviio/doinst.sh new file mode 100644 index 0000000000..710245989d --- /dev/null +++ b/multimedia/serviio/doinst.sh @@ -0,0 +1,25 @@ +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 rc.serviio.new |