From 1cea6afdc176c7a08e57adf112dd6d699742ba24 Mon Sep 17 00:00:00 2001 From: mario Date: Mon, 3 Jun 2013 17:33:01 -0500 Subject: system/freeswitch: Added (Open source telephony platform) Signed-off-by: Robby Workman --- system/freeswitch/doinst.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 system/freeswitch/doinst.sh (limited to 'system/freeswitch/doinst.sh') diff --git a/system/freeswitch/doinst.sh b/system/freeswitch/doinst.sh new file mode 100644 index 0000000000..e9bc581d41 --- /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 + -- cgit v1.2.3