aboutsummaryrefslogtreecommitdiff
path: root/network/smstools3/doinst.sh
diff options
context:
space:
mode:
authorDavid Woodfall <dave@dawoodfall.net>2010-10-15 22:39:52 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-10-15 22:39:52 -0500
commit378d921afcbe43fc0acf7d79881fe5cf194572d4 (patch)
tree0e0c5820c26312dfa52464ff84de9bae0d0dc8ad /network/smstools3/doinst.sh
parent3ecfa23e5c1bdf24ffef0b08f3197ea9709fb7ec (diff)
network/smstools3: Added (SMS Server Tools)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/smstools3/doinst.sh')
-rw-r--r--network/smstools3/doinst.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/network/smstools3/doinst.sh b/network/smstools3/doinst.sh
new file mode 100644
index 0000000000000..35e58cf2ffa42
--- /dev/null
+++ b/network/smstools3/doinst.sh
@@ -0,0 +1,28 @@
+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.sms3.new
+#chgrp -R dialout /var/spool/sms
+#chmod -R g+rw /var/spool/sms
+