summaryrefslogtreecommitdiffstats
path: root/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl')
-rwxr-xr-xencap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl162
1 files changed, 0 insertions, 162 deletions
diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl
deleted file mode 100755
index 68c5798d8..000000000
--- a/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl
+++ /dev/null
@@ -1,162 +0,0 @@
-#include "site-settings.conf"
-#compiler-settings
-cheetahVarStartToken = @
-commentStartToken = %%
-#end compiler-settings
-#!/bin/sh -e
-
-umask 002
-BASEDIR="${ENCAP_TARGET}" # Usually /usr/local
-PKGDIR="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" # Ususally /usr/local/encap/<pkgname>
-LOG="${PKGDIR}/postinstall.log"
-MKINSTALLDIRS="${PKGDIR}/mkinstalldirs"
-exec > $LOG 2>&1
-
-printf "Running ${ENCAP_PKGNAME} postinstall script...\n"
-date
-
-chmod 755 ${MKINSTALLDIRS}
-${MKINSTALLDIRS} "${BASEDIR}/etc/default/bcfg2-client/env"
-${MKINSTALLDIRS} "${BASEDIR}/etc/default/bcfg2-server/env"
-${MKINSTALLDIRS} "${BASEDIR}/sbin"
-
-rmcp() {
- SRCFILENAME="`basename ${1}`"
- if [ -d "${2}" ]; then
- DESTDIRNAME="$2"
- else
- DESTDIRNAME="`dirname ${2}`"
- fi
- TARGETNAME="$DESTDIRNAME/$SRCFILENAME"
- RMTARGET="no"
- if [ -h "$TARGETNAME" ]; then RMTARGET="yes"; fi
- if [ -f "$TARGETNAME" ]; then RMTARGET="yes"; fi
- if [ "${RMTARGET}x"="yesx" ]; then
- DATE="`date +%Y-%m-%d--%H-%M-%S`"
- printf "INFO: Moving old $TARGETNAME to ${TARGETNAME}-${DATE}...\n"
- cp "$TARGETNAME" "${TARGETNAME}-${DATE}" && rm "$TARGETNAME"
- fi
- printf "INFO: Copying %s to %s...\n" "$1" "$2"
- cp "$1" "$2"
-}
-
-# bcfg2-client (options)
-if [ "${REPLACE_CONFIG}x" = "yesx" ]; then
- printf "REPLACE_CONFIG=yes, so removing bcfg2-client sentinel files...\n"
- S_B="${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_BCFG2"
- test -f ${S_B} && rm ${S_B}
- S_S="${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_SITE"
- test -f ${S_S} && rm ${S_S}
-fi
-
-if [ -f ${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_BCFG2 ]; then
- printf "INFO: bcfg2 client options have been updated by bcfg2 -\n"
- printf "INFO: not replacing that configuration.\n"
-elif [ -f ${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_SITE ]; then
- printf "INFO: bcfg2 client options have been previously updated -\n"
- printf "INFO: not replacing that configuration.\n"
-else
- DIR="etc/default/bcfg2-client"
- rmcp $PKGDIR/$DIR/env/RUN_INTERVAL_SECONDS ${BASEDIR}/$DIR/env/
- rmcp $PKGDIR/$DIR/env/OPTIONS ${BASEDIR}/$DIR/env/
- touch ${BASEDIR}/$DIR/.SENTINEL_SITE
-fi
-
-# bcfg2-server (options)
-if [ "${REPLACE_CONFIG}x" = "yesx" ]; then
- printf "REPLACE_CONFIG=yes, so removing bcfg2-server sentinel files...\n"
- S_B="${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_BCFG2"
- test -f ${S_B} && rm ${S_B}
- S_S="${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_SITE"
- test -f ${S_S} && rm ${S_S}
-fi
-
-if [ -f ${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_BCFG2 ]; then
- printf "INFO: bcfg2 server options have been updated by bcfg2 -\n"
- printf "INFO: not replacing that configuration.\n"
-elif [ -f ${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_SITE ]; then
- printf "INFO: bcfg2 server options have been previously updated -\n"
- printf "INFO: not replacing that configuration.\n"
-else
- DIR="etc/default/bcfg2-server"
- rmcp $PKGDIR/$DIR/env/OPTIONS ${BASEDIR}/$DIR/env/
- touch ${BASEDIR}/$DIR/.SENTINEL_SITE
-fi
-
-# bcfg2.conf & ostiary.conf
-if [ "${REPLACE_CONFIG}x" = "yesx" ]; then
- printf "REPLACE_CONFIG=yes, so removing ${BASEDIR}/etc sentinel files...\n"
- S_B="${BASEDIR}/etc/.SENTINEL_BCFG2"
- test -f ${S_B} && rm ${S_B}
- S_S="${BASEDIR}/etc/.SENTINEL_SITE"
- test -f ${S_S} && rm ${S_S}
-fi
-
-if [ -f ${BASEDIR}/etc/.SENTINEL_BCFG2 ]; then
- printf "INFO: bcfg2.conf and/or ostiary.cfg may have been updated by\n"
- printf "INFO: bcfg2 - not replacing that configuration.\n"
-elif [ -f ${BASEDIR}/etc/.SENTINEL_SITE ]; then
- printf "INFO: bcfg2.conf and/or ostiary.cfg may have been previously\n"
- printf "INFO: updated - not replacing that configuration.\n"
-else
- rmcp $PKGDIR/etc/bcfg2.conf ${BASEDIR}/etc/
- rmcp $PKGDIR/etc/ostiary.cfg ${BASEDIR}/etc/
- touch ${BASEDIR}/etc/.SENTINEL_SITE
-fi
-
-# sbin/ost-bcfg2*
-if [ "${REPLACE_CONFIG}x" = "yesx" ]; then
- printf "REPLACE_CONFIG=yes, so removing ${BASEDIR}/sbin sentinel files...\n"
- S_B="${BASEDIR}/sbin/.SENTINEL_BCFG2"
- test -f ${S_B} && rm ${S_B}
- S_S="${BASEDIR}/sbin/.SENTINEL_SITE"
- test -f ${S_S} && rm ${S_S}
-fi
-
-if [ -f ${BASEDIR}/sbin/.SENTINEL_BCFG2 ]; then
- printf "INFO: sbin/ost-bcfg2* may have been updated by bcfg2 -\n"
- printf "INFO: not replacing that configuration with this script.\n"
-elif [ -f ${BASEDIR}/sbin/.SENTINEL_SITE ]; then
- printf "INFO: sbin/ost-bcfg2* may have been previously updated -\n"
- printf "INFO: not replacing that configuration with this script.\n"
-else
- OSTSH="ost-bcfg2-dv ost-bcfg2-dvn ost-bcfg2-dvq ost-bcfg2-dvqn ost-bcfg2-restart ost-bcfg2.sh ost-bcfg2-v ost-bcfg2-vq"
- for OSTFILE in $OSTSH; do
- rmcp $PKGDIR/sbin/${OSTFILE} ${BASEDIR}/sbin/
- done
- chmod 700 ${BASEDIR}/sbin/*
- touch ${BASEDIR}/sbin/.SENTINEL_SITE
-fi
-
-# ostiary (runit)
-if [ ! -h /usr/local/var/service/ostiary ]; then
- if [ -d /usr/local/etc/sv/ostiary ]; then
- printf "INFO: Enabling ostiary service (via runit)...\n"
- ln -s /usr/local/etc/sv/ostiary /usr/local/var/service/ostiary
- else
- printf "ERROR: /usr/local/etc/sv/ostiary does not exist.\n"
- exit 1
- fi
-else
- printf "INFO: /usr/local/var/service/ostiary already exists, not replacing...\n"
-fi
-
-# bcfg2-client (runit)
-%%if int(@BCFG2_CLIENT_RUN_INTERVAL_SECONDS) > 0
-if [ ! -h /usr/local/var/service/bcfg2-client ]; then
- if [ -d /usr/local/etc/sv/bcfg2-client ]; then
- printf "INFO: Enabling bcfg2-client service (via runit)...\n"
- ln -s /usr/local/etc/sv/bcfg2-client /usr/local/var/service/bcfg2-client
- else
- printf "ERROR: /usr/local/etc/sv/bcfg2-client does not exist.\n"
- printf "ERROR: Could not enable bcfg2-client service.\n"
- fi
-else
- printf "INFO: /usr/local/var/service/bcfg2-client already exists, not replacing...\n"
-fi
-%%end if
-
-# end
-printf "Finished ${ENCAP_PKGNAME} postinstall script.\n"
-
-exit 0