aboutsummaryrefslogtreecommitdiff
path: root/system/facter/doinst.sh
diff options
context:
space:
mode:
authorThibaut Notteboom <thibaut.notteboom@gmail.com>2015-07-02 22:49:09 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-07-04 10:38:16 +0700
commit67ab739de327104a32548f379157222cc5c8c294 (patch)
tree21c2640b001032c8b1e3b9f946dbf1a5c45287f3 /system/facter/doinst.sh
parentb7ef32891c6c20f91bdccaa3cbabff9d0fde2aa2 (diff)
system/facter: Updated for version 3.0.1 (moved from ruby).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/facter/doinst.sh')
-rw-r--r--system/facter/doinst.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/system/facter/doinst.sh b/system/facter/doinst.sh
new file mode 100644
index 0000000000000..65ce6d65a5457
--- /dev/null
+++ b/system/facter/doinst.sh
@@ -0,0 +1,14 @@
+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...
+}
+
+config etc/facter.conf.new