aboutsummaryrefslogtreecommitdiff
path: root/audio/darkice/doinst.sh
diff options
context:
space:
mode:
authorMarcel Saegebarth <marc@mos6581.de>2014-10-03 08:11:03 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-10-03 10:17:03 +0700
commit2234748620f1f808c5830971518f51a888dbc255 (patch)
treed96f5424ad0c8e39e676ef468efa06cdad73fe4e /audio/darkice/doinst.sh
parent5d86f71a5cffcfdfc4eb4bd7ba6b65f1ea441044 (diff)
audio/darkice: Added (live audio streamer).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'audio/darkice/doinst.sh')
-rw-r--r--audio/darkice/doinst.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/audio/darkice/doinst.sh b/audio/darkice/doinst.sh
new file mode 100644
index 0000000000000..f8f9a6e459734
--- /dev/null
+++ b/audio/darkice/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 etc/rc.d/rc.darkice.new