summaryrefslogtreecommitdiff
path: root/system/profile-sync-daemon/doinst.sh
diff options
context:
space:
mode:
authorMarcel Saegebarth <marc@mos6581.de>2014-11-19 23:00:38 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-11-19 23:30:10 +0700
commit13889c1313bc8bc57bfbc7f849f8694c9eeb0d1d (patch)
tree86bf58230149a93848b245cc3dde46e6d1660be9 /system/profile-sync-daemon/doinst.sh
parent7de3191028874a308a8e1601c5a1bfc411ba8ef5 (diff)
downloadslackbuilds-13889c1313bc8bc57bfbc7f849f8694c9eeb0d1d.tar.gz
system/profile-sync-daemon: Added (Manage browser profiles).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/profile-sync-daemon/doinst.sh')
-rw-r--r--system/profile-sync-daemon/doinst.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/system/profile-sync-daemon/doinst.sh b/system/profile-sync-daemon/doinst.sh
new file mode 100644
index 0000000000..dd0e684583
--- /dev/null
+++ b/system/profile-sync-daemon/doinst.sh
@@ -0,0 +1,27 @@
+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.psd.new
+config etc/cron.hourly/psd-update.new
+config etc/psd.conf.new