summaryrefslogtreecommitdiff
path: root/system/docker/doinst.sh
diff options
context:
space:
mode:
authorVincent Batts <vbatts@hashbangbash.com>2014-01-30 13:13:54 -0600
committerErik Hanson <erik@slackbuilds.org>2014-02-08 11:09:51 -0600
commitf1e2b846410cb6fc34da5f3ce4b85dc035810eb3 (patch)
tree8ba3233a0e734b21498d7f967e4e82afdf557c6a /system/docker/doinst.sh
parent3059f8abc4dcd52c9b2c3f702505b51b83517ab5 (diff)
downloadslackbuilds-f1e2b846410cb6fc34da5f3ce4b85dc035810eb3.tar.gz
system/docker: Added (manager for applications in linux containers)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/docker/doinst.sh')
-rw-r--r--system/docker/doinst.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/system/docker/doinst.sh b/system/docker/doinst.sh
new file mode 100644
index 0000000000..56e6b591a2
--- /dev/null
+++ b/system/docker/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.docker.new
+config etc/default/docker.new
+config etc/logrotate.d/docker.new
+