diff options
author | Vincent Batts <vbatts@hashbangbash.com> | 2014-01-30 13:13:54 -0600 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2014-02-08 11:09:51 -0600 |
commit | f1e2b846410cb6fc34da5f3ce4b85dc035810eb3 (patch) | |
tree | 8ba3233a0e734b21498d7f967e4e82afdf557c6a /system/docker/doinst.sh | |
parent | 3059f8abc4dcd52c9b2c3f702505b51b83517ab5 (diff) | |
download | slackbuilds-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.sh | 28 |
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 + |