summarylogtreecommitdiffstats
path: root/cfengine.install
diff options
context:
space:
mode:
authorVanush Misha Paturyan2016-02-20 14:27:22 +0000
committerVanush "Misha" Paturyan2016-02-20 14:32:55 +0000
commitd85ce7ac2e11a8c9ec88889d8aec09c743be78a7 (patch)
tree21e617997d42b218a806cc2a00320d3e8e0b2015 /cfengine.install
parentfdbc6e689db57d5205def94bdf73600d8b544f0c (diff)
downloadaur-d85ce7ac2e11a8c9ec88889d8aec09c743be78a7.tar.gz
version 3.7.2 and a new maintainer
- version 3.7.2 is upstream's LTS version - depends on lmdb instead of qdbm/tokyocabinet - depends on pam - installs stock policy into /usr/share/doc/cfengine/CoreBase - on install copies stock policy into /var/cfengine/masterfiles
Diffstat (limited to 'cfengine.install')
-rw-r--r--cfengine.install34
1 files changed, 25 insertions, 9 deletions
diff --git a/cfengine.install b/cfengine.install
index fad7bbaca45..d9820b51164 100644
--- a/cfengine.install
+++ b/cfengine.install
@@ -1,19 +1,35 @@
+PREFIX=/var/cfengine
+
post_install() {
- if [ ! -f /var/cfengine/ppkeys/localhost.priv ]; then
- cf-key > /dev/null
+# generate a host key
+ if [ ! -f $PREFIX/ppkeys/localhost.priv ]; then
+ $PREFIX/bin/cf-key > /dev/null
fi
- if ! [ -f /var/cfengine/masterfiles/promises.cf ]; then
- cp -R /usr/share/CoreBase/* /var/cfengine/masterfiles/
+# copy the stock policy for the new installations and create promies_validated
+ if ! [ -f $PREFIX/masterfiles/promises.cf ]; then
+ /bin/cp -R /usr/share/doc/cfengine/CoreBase/masterfiles/* $PREFIX/masterfiles/
+ $PREFIX/bin/cf-promises -T $PREFIX/masterfiles
+ fi
+
+# copy modules/packages (part of stock policy)
+ if ! [ -f $PREFIX/modules/packages ]; then
+ mkdir -p $PREFIX/modules/packages
fi
-
- if ! [ -f /var/cfengine/bin/cf-promises ]; then
- cd /var/cfengine/bin
- ln -s /usr/bin/cf-* .
+ if cd /usr/share/doc/cfengine/CoreBase/modules/packages; then
+ for module in *; do
+ if ! [ -f $PREFIX/modules/packages/$module ]; then
+ cp $module $PREFIX/modules/packages
+ fi
+ done
fi
+ #if ! [ -f /var/cfengine/bin/cf-promises ]; then
+ # cd /var/cfengine/bin
+ # ln -s /usr/bin/cf-* .
+ #fi
- echo "Bootstrap cfengine with cf-agent --bootstrap <IP address of policy server>"
+ echo -e "\nBootstrap cfengine with cf-agent --bootstrap <IP address of policy server>\n"
}
post_remove() {