aboutsummaryrefslogtreecommitdiff
path: root/system/freeswitch/doinst.sh
diff options
context:
space:
mode:
authormario <mario@slackverse.org>2013-06-03 17:33:01 -0500
committerRobby Workman <rworkman@slackbuilds.org>2013-06-04 00:11:33 -0500
commit1cea6afdc176c7a08e57adf112dd6d699742ba24 (patch)
tree9ac81a67b177706305834f9f31dc8b56141b37fb /system/freeswitch/doinst.sh
parentca77a5a0a0bd68537c6f629c84519b26c10a23d1 (diff)
system/freeswitch: Added (Open source telephony platform)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/freeswitch/doinst.sh')
-rw-r--r--system/freeswitch/doinst.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/system/freeswitch/doinst.sh b/system/freeswitch/doinst.sh
new file mode 100644
index 000000000000..e9bc581d4191
--- /dev/null
+++ b/system/freeswitch/doinst.sh
@@ -0,0 +1,31 @@
+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.freeswitch.new
+config etc/logrotate.d/freeswitch.new
+
+for i in $(find opt/freeswitch/conf -type f -name '*.new'); do
+ config $i
+done
+