summaryrefslogtreecommitdiff
path: root/network/t38modem/doinst.sh
diff options
context:
space:
mode:
authorChris Walker <kris240376@gmail.com>2020-04-02 00:08:34 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-04-02 00:08:34 +0700
commit4510e38975f8602e5e03502be518b9402837cbec (patch)
treeeda74dc50782a9e52a715b4ae64504e60a9c3ae4 /network/t38modem/doinst.sh
parentceabc95edbfbf946484cf2779aaa6380ab34d5cf (diff)
downloadslackbuilds-4510e38975f8602e5e03502be518b9402837cbec.tar.gz
network/t38modem: Updated for version 3.15.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/t38modem/doinst.sh')
-rw-r--r--network/t38modem/doinst.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/network/t38modem/doinst.sh b/network/t38modem/doinst.sh
new file mode 100644
index 0000000000..29b7e602de
--- /dev/null
+++ b/network/t38modem/doinst.sh
@@ -0,0 +1,26 @@
+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.t38modem.new
+config etc/rc.d/rc.t38modem.conf.new
+